Matlab: plotting one period of a discrete signal

  • #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.

Cheers

Steve
 

Attachments

  • matlab PF.docx
    95.9 KB · Views: 154

Answers and Replies

  • #2
berkeman
Mentor
60,847
11,235
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:
 
  • #3
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.
 
  • #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)
 

Related Threads on Matlab: plotting one period of a discrete signal

  • Last Post
Replies
2
Views
6K
Replies
3
Views
6K
  • Last Post
Replies
6
Views
772
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
1
Views
2K
Replies
8
Views
725
  • Last Post
Replies
1
Views
666
  • Last Post
Replies
5
Views
24K
  • Last Post
Replies
0
Views
2K
Top