diff options
Diffstat (limited to '830/CH12/EX12.1.1/spectrum_of_signal.sce')
-rwxr-xr-x | 830/CH12/EX12.1.1/spectrum_of_signal.sce | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/830/CH12/EX12.1.1/spectrum_of_signal.sce b/830/CH12/EX12.1.1/spectrum_of_signal.sce new file mode 100755 index 000000000..32b8c187f --- /dev/null +++ b/830/CH12/EX12.1.1/spectrum_of_signal.sce @@ -0,0 +1,27 @@ +//Graphical//
+//Example 12.1.1
+//Determination of spectrum of a signal
+//With maximum normalized frequency f = 0.1
+//using Rectangular window and Blackmann window
+clear;
+close;
+clc;
+N = 61;
+cfreq = [0.1 0];
+[wft,wfm,fr]=wfir('lp',N,cfreq,'re',0);
+wft; // Time domain filter coefficients
+wfm; // Frequency domain filter values
+fr; // Frequency sample points
+WFM_dB = 20*log10(wfm);//Frequency response in dB
+for n = 1:N
+ h_balckmann(n)=0.42-0.5*cos(2*%pi*n/(N-1))+0.08*cos(4*%pi*n/(N-1));
+end
+wft_blmn = wft'.*h_balckmann;
+wfm_blmn = frmag(wft_blmn,length(fr));
+WFM_blmn_dB =20*log10(wfm_blmn);
+subplot(2,1,1)
+plot2d(fr,WFM_dB)
+xtitle('Frequency Response of Rectangular window Filtered output M = 61','Frequency in cycles per samples f','Energy density in dB')
+subplot(2,1,2)
+plot2d(fr,WFM_blmn_dB)
+xtitle('Frequency Response of Blackmann window Filtered output M = 61','Frequency in cycles per samples f','Energy density in dB')
|