1. PF Contest - Win "Conquering the Physics GRE" book! Click Here to Enter
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab: plotting one period of a discrete signal

  1. Mar 26, 2014 #1
    I have a 3 rad/s sine wave that I am sampling every 2 seconds.

    The slow sampling has created an alias of -0.14 rad/s.

    I have plotted this over the top of the original continuous time signal, please see attachment.

    My problem is that I only want to plot the first period of the discrete signal, i.e. end at 44.88 seconds, but I want to plot the original CT signal for the full 60 seconds.

    I'm going around in circles and getting some strange results. Hopefully somebody out there can shed some light.



    Attached Files:

  2. jcsd
  3. Mar 26, 2014 #2


    User Avatar

    Staff: Mentor

    Are you doing this to illustrate aliasing on purpose? What is the context of this work? It seems like you can plot whatever you want -- what is the issue? Sorry if I'm missing the obvious... :smile:
  4. Mar 26, 2014 #3

    I'm in the process of making a GUI that prompts a user for signal frequency, sample time and length.

    If the user enters a sampling rate that is insufficient I want to lay the first cycle of the aliased signal over the original CTsignal to, as you say, illustrate aliasing.

    As you can see from my attachment I have successfully overlaid the aliased signal, but I would like to only display the primary period.
  5. Mar 30, 2014 #4
    I managed to sort my problem out…. sort of.

    I found the time taken to make one revolution

    Circle time= (1/frequency) x 2 x π

    And then made a vector from zero to

    circle time x (1/sampling time)
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted

Similar Threads - Matlab plotting period Date
Plotting with Matlab Feb 18, 2017
Find Fourier transform and plot spectrum by hand & MATLAB Dec 1, 2016
Plotting in Matlab Nov 12, 2016
Matlab plotting Jun 8, 2016
How i can plot anti periodic sine wave in matlab ? Oct 2, 2012