function surname3 % 1.plot the frequency response of the following discrete-time systems. % % a. notch filter with 0db maximum gain, r = 0.75, w = pi/4 (figure 1) % b. digital resonators with 0db maximum gain, r = .75, w = pi/4 (figure 2) % c. comb filter with 0 db maximum gain, l =7, m =8 (figure 3) r1=0.75; w1=pi/4; b1 = [1 -2*cos(w1) 1]; a1 = [1 -2*r1*cos(w1) r1^2]; figure(1) freqz(b1,a1); title('notch filter'); b2 = [1 0 -1]; a2 = [1 -2*r1*cos(w1) r1^2]; figure(2) freqz(b2,a2);title('digital resonator'); b3 = [1 zeros(0,61) -1]; a3 = [1 0 0 0 0 0 0 -1]; figure(3) freqz(b3,a3);title('comb filter'); % 2.plot the frequency response of the discrete-time sequences using the matlab function fft. % use the following number of samples in the frequency domain, n = 16, 32, 64, and 128. % the magnitude should be expressed in decibels and the 4 magnitude responses should be % plotted in figure 4. use different colors for different values of n. n = [0:15]; unit = [ones(1,16)] ; xn= ((3/4).^n)*unit + (3/4)*cos(pi.*n/2)*unit; n=[16 32 64 128]; [x,w]=freqz(b,a,512,'whole'); for m=1:length(n) x=(1/2).^[0:511]; x1=fft(x,n(m)); k=0:n(m)-1; w1=k*2*pi/n(m); plot(w1,20*log10(abs(x1)),c(m)); hold on; end % 3.display the following in figure 4: a.) the frequency spectrum of the image mapped_gray.jpg, % b.) the image mapped_gray.jpg, c.) the filtered image, d.) spectrum of the filtered image, % e.) the spectrum of the twodimensional filter, and f.) the spectrum of the two-dimensional % filter in 3d. the center of the spectrum must be at the center and the resolution of the % spectrum must be 512 x 512. use the following filter coefficients:
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
Trusted by over 1 million members
Try Scribd FREE for 30 days to access over 125 million titles without ads or interruptions! Start Free Trial Cancel Anytime.
h=[-1 -1 -1;-1 8 -1;-1 -1 -1]
figure(5)
% 4.plot the audio signal mydtmf.wav and its corresponding spectrogram in figure the number of samples per frame should be 256 with 128 overlaps. [x4,fs,nbits] = wavread('mydtmf.wav');
% 5.the z-transform of a causal sequence is give by the expression given below.
b5=[0.0947 0.2481 0.2481 0.0947]; a5=[1 -0.7130 0.6287 -0.1581];