Matlab: plotting one period of a discrete signal

Click For Summary

Discussion Overview

The discussion revolves around the challenges of plotting a discrete signal derived from a continuous sine wave, specifically focusing on aliasing effects and the visualization of one period of the discrete signal alongside the full continuous time signal.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested
  • Experimental/applied

Main Points Raised

  • One participant describes a 3 rad/s sine wave sampled every 2 seconds, resulting in an alias of -0.14 rad/s, and expresses confusion about plotting the first period of the discrete signal while displaying the continuous signal for the full duration.
  • Another participant questions the purpose of the plot and the context of the work, suggesting that the issue may not be clear and asking for clarification.
  • A participant mentions they are developing a GUI that allows users to input signal frequency and sampling time, intending to illustrate aliasing by overlaying the aliased signal on the original continuous signal when insufficient sampling rates are used.
  • One participant reports progress in resolving their issue by calculating the time for one revolution of the sine wave and creating a vector to represent the necessary time points for plotting.

Areas of Agreement / Disagreement

Participants express varying levels of understanding regarding the plotting issue, with some seeking clarification and others providing insights. The discussion does not reach a consensus on the best approach to resolve the plotting challenge.

Contextual Notes

There are unresolved aspects regarding the specific implementation details of the plotting and the assumptions made about the sampling rate and its effects on the signal representation.

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 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
4K