I have a respiration signal which is sinusoidal in shape. I have fitted the curve using Fourier series. Since the fitted curve is in cfit format, I am not able to find it's Power Spectral Density.
John Michell answered .
2025-11-20
yhat=resp_f(t);
to get predicted y at times t
Obtain the periodogram for an even-length signal sampled at 1 kHz using both fft and periodogram. Compare the results.
Create a signal consisting of a 100 Hz sine wave in N(0,1) additive noise. The sampling frequency is 1 kHz. The signal length is 1000 samples. Use the default settings of the random number generator for reproducible results.
rng default Fs = 1000; t = 0:1/Fs:1-1/Fs; x = cos(2*pi*100*t) + randn(size(t));
Obtain the periodogram using fft. The signal is real-valued and has even length. Because the signal is real-valued, you only need power estimates for the positive or negative frequencies. In order to conserve the total power, multiply all frequencies that occur in both sets — the positive and negative frequencies — by a factor of 2. Zero frequency (DC) and the Nyquist frequency do not occur twice. Plot the result.
ASK NOW