Wednesday, July 25, 2018

matlab - PSD of sine wave


I'm learning some basic signal processing to use in my research. So I'm trying to understand the pwelch function in MATLAB to calculate the PSD. My understanding was that the PSD is the density of power in the frequency bins, and thus the PSD of a sine wave should be a delta function. However, when I run my simple code I get a distribution.



enter image description here



  • Why is this happening?

  • Is this something to do with windowing?

  • Or is my understanding of PSD wrong?


EDIT:


Here is my MATLAB code:


rng('default');
fs = 1

n = 0:1/fs:200000;
x = sin(2*pi*n);
pwelch(x);


No comments:

Post a Comment

periodic trends - Comparing radii in lithium, beryllium, magnesium, aluminium and sodium ions

Apparently the of last four, $\ce{Mg^2+}$ is closest in radius to $\ce{Li+}$. Is this true, and if so, why would a whole larger shell ($\ce{...