正在加载图片...
8 These MATLAB statements desigm ard analyze IIR and FIR filter clear, cl 8 clear memory and figure window i specify sapling frequency ban=[500/40001800/4000] s specify passband in normalized frec 8 compute passband ripple 8 capute stopband ripple [Bl, Al] ellip(4, Rp, Rs, band); 8 design elliptic passband filter B2 firl(70, bena) g design causal FIR filter n, f]= frege(B1, A1, 512, Fs) s compute frequency content of filters [H, E]= fretz(B2, 1, 512, Fs) mag H= abs(H); magH2= abs(H 2): 8 caput tude of filters [gal, f]=grpdelay(Bl, Al, 512, Fs): 8 caput delay of filters [gd2, f] grpdelay (B2, 1, 512, Fs) 6 plot filter magnitudes subplot(2,1, 1), plot(f, abs(H1),f, abs(H2),--), xlabel(Frequency,Hz title('Camparisan of IIR and FIR Filters), grid, pause 多 B plot group dela ibplot (2,1,1),plot(f, gd1),title(Group y IIR Filter), grid, subplot(2, 1,2),plot(f, gd2),title(' Group FIR Filter xlabel( Frequency Hz), grid, pause 8 capute and plot ipulse responses clf [h,t]=impz(B1,A1,100,Fs); h2,t]=impz(B2,1,100,Fs}; subplot(2, 1, 1), stem(t, h1),title('Irpulse Response IIR Filter), grid. ubplot(2, 1, 2), stem(t, h2),title("Ipulse Response- FIR Filter),grid, xlabel("Time, s'),pause 6 determine and plot poles and zeros of IIR filter zplane(B1, A1), title('poles/Zeros for IIR Filter'),pause FIGURE 21.9 interpolation process requires that an integral number of points, L-1, be interpolated between existing points, such as interpolation of 5 new points between existing pairs of points. The decimation process increases a sampling interval by M, and the interpolation process decreases a sampling interval by a factor of L MATLAB ntains functions for decimation and interpolation, as well as a function for a resampling of a signal using a non-integer factor of P/Q where P and Q are integers Consider a signal that is one sinusoid modulated by another sinusoid. The signal has been sampled at a frequency chosen to provide efficient storage of the data. However, when plotting the data for further analysis, we want to interpolate by a factor of 8 so that the signal looks smoother. Therefore, we use the MATLAB interpolation function Figure 21.10 contains plots of the original and interpolated time signals. Figure 21.11 contains frequency plots to confirm that the interpolation did not significantly affect the frequency content. Figure 21.12 contains the MATLAB code for this process c 2000 by CRC Press LLC© 2000 by CRC Press LLC interpolation process requires that an integral number of points, L-1, be interpolated between existing points, such as interpolation of 5 new points between existing pairs of points. The decimation process increases a sampling interval by M, and the interpolation process decreases a sampling interval by a factor of L. MATLAB contains functions for decimation and interpolation, as well as a function for a resampling of a signal using a non-integer factor of P/Q where P and Q are integers. Consider a signal that is one sinusoid modulated by another sinusoid. The signal has been sampled at a frequency chosen to provide efficient storage of the data. However, when plotting the data for further analysis, we want to interpolate by a factor of 8 so that the signal looks smoother. Therefore, we use the MATLAB interpolation function. Figure 21.10 contains plots of the original and interpolated time signals. Figure 21.11 contains frequency plots to confirm that the interpolation did not significantly affect the frequency content. Figure 21.12 contains the MATLAB code for this process. FIGURE 21.9
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有