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