Issue in finding Power Spectral Density of fitted curve

I
ishitaisha6840 · Jan 25, 2021 · 1.9K views
Question
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.
Expert Answer
Profile picture of John Michell
John Michell PhD Expert
Answered Aug 12, 2026
Evaluate the fit at the desired frequency for however long you have data and pass that result to fft
 
ADDENDUM: See the comment below for specific, but just use
 
 
yhat=resp_f(t);

to get predicted y at times t

 

 

 

Even-Length Input with Sample Rate

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.

100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!