Matlab: plotting one period of a discrete signal

AI Thread Summary
The discussion revolves around plotting a 3 rad/s sine wave sampled every 2 seconds, resulting in an alias of -0.14 rad/s. The user aims to illustrate aliasing by overlaying the aliased discrete signal on the original continuous time (CT) signal, but wants to display only the first period of the discrete signal, ending at 44.88 seconds, while showing the CT signal for the full 60 seconds. The user has successfully overlaid the signals but encountered challenges in isolating the primary period of the aliased signal. They calculated the time for one complete cycle and created a vector to assist with the plotting. The discussion highlights the complexities of visualizing aliasing effects in signal processing.
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)
 

Similar threads

Replies
1
Views
2K
Replies
6
Views
5K
Replies
5
Views
2K
Replies
3
Views
2K
Replies
3
Views
2K
Replies
4
Views
2K
Replies
1
Views
1K
Replies
1
Views
362
Back
Top