Matlab: plotting one period of a discrete signal

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
3 replies · 3K views
Steve Collins
Messages
45
Reaction score
0
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.

Cheers

Steve
 
Attachments
Physics news on Phys.org
Steve Collins said:
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.

Cheers

Steve

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:
 
berkeman said:
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:


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.
 
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)