pseudockb
Member level 5
adc snr matlab
Hi, I have some question regarding the script I got. Part of it is as follows:
.
.
.
% Create the minimum, 4-term Blackman-Harris window for FFT
pwr_win=0;
for i=1:Nt %where Nt is the no. of FFT bins
window(1,i)=0.35875-0.48829*cos(2*pi*(i-1)/Nt)+0.14128*cos(4*pi*(i-1)/Nt)-0.01168*cos(6*pi*(i-1)/Nt);
pwr_win=pwr_win+window(1,i)*window(1,i);
end
xn=xn.*window; %add window
yn=fft(xn); %DFT
pyy=yn.*conj(yn)/Nt/pwr_win; %compute power spectrum (1~Nt)
pyy(2Nt/2))=2*pyy(2Nt/2)); %add the negative freq. to positive freq.
pyy((Nt/2+2):Nt)=[]; %eliminate the negative freq.
.
.
.
Could someone please explain to me what is the use of pwr_win? I don't quite understand what "pyy=yn.*conj(yn)/Nt/pwr_win;" is trying to do. Please help me. Thanks!
Hi, I have some question regarding the script I got. Part of it is as follows:
.
.
.
% Create the minimum, 4-term Blackman-Harris window for FFT
pwr_win=0;
for i=1:Nt %where Nt is the no. of FFT bins
window(1,i)=0.35875-0.48829*cos(2*pi*(i-1)/Nt)+0.14128*cos(4*pi*(i-1)/Nt)-0.01168*cos(6*pi*(i-1)/Nt);
pwr_win=pwr_win+window(1,i)*window(1,i);
end
xn=xn.*window; %add window
yn=fft(xn); %DFT
pyy=yn.*conj(yn)/Nt/pwr_win; %compute power spectrum (1~Nt)
pyy(2Nt/2))=2*pyy(2Nt/2)); %add the negative freq. to positive freq.
pyy((Nt/2+2):Nt)=[]; %eliminate the negative freq.
.
.
.
Could someone please explain to me what is the use of pwr_win? I don't quite understand what "pyy=yn.*conj(yn)/Nt/pwr_win;" is trying to do. Please help me. Thanks!