26.8k views
3 votes
A noisy signal has been uploaded to D2L in the files fft_signal.mat and fft_signal.txt.Write a program to estimate the power spectral density of the signal and determinethe frequency components used to construct it. Submit your code along with yourassignment. You can compare against the MatlabĀ® built-in function pwelch to makesure your code is working properly. Note: All of the functions you will need forwindowing and computing FFTs are built into MatlabĀ®. Your primary task will beto write the logic/loops required to use them to replicate the behavior of pwelch (i.e.power spectrum using segmenting and windowing). You can use a window size of 256.

User Elk
by
5.6k points

1 Answer

6 votes

Answer:

Answer: Program to estimate the power spectral density of the signal

Step-by-step explanation:

fs= 4000; % Hz sample rate Ts= 1/fs; f0= 500; % Hz sine frequency A= sqrt(2); % V sine amplitude for P= 1 W into 1 ohm. N= 1024; % number of time samples n= 0:N-1; % time index x= A*sin(2*pi*f0*n*Ts) + .1*randn(1,N); % 1 W sinewave + noise

Spectrum in dBW/Hz

nfft= N; window= rectwin(nfft); [pxx,f]= pwelch(x,window,0,nfft,fs); % W/Hz power spectral density PdB_Hz= 10*log10(pxx); % dBW/Hz

Spectrum in dBW/bin

nfft= N; window= rectwin(nfft); [pxx,f]= pwelch(x,window,0,nfft,fs); % W/Hz power spectral density PdB_bin= 10*log10(pxx*fs/nfft); % dBW/bin

User Adam Gritt
by
5.7k points