periodogram for 200 Hz sample rate returns 129 array length
1 view (last 30 days)
Show older comments
why periodogram for 200 Hz sample rate, for 1 second, returns an array lenght of 129, if called without parameters. why it's not 100
signal = linspace(0,3000,200)'; %this is 1 second of my signal (200 because that's the sample rate)
[x,y] = periodogram(signal,[],[],200);
x
0 Comments
Accepted Answer
Paul
on 24 Jan 2023
Hi sam,
signal = linspace(0,3000,200)'; %this is 1 second of my signal (200 because that's the sample rate)
[x,y] = periodogram(signal,[],[],200);
numel(signal)
Because signal is only 200 elements and nfft is set for default, nfft will be (according to periodogram)
nfft = max(256,2^nextpow2(length(signal)))
The default for "freqrange" is 'onesided', in which case with nfft = 256, x will have length nfft/2 + 1 = 129 (also on periodogram)
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!