solns8_600(2) - ECE-600 Introduction to Digital Signal...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ECE-600 Introduction to Digital Signal Processing Autumn 2010 Homework #8 Dec. 4, 2010 HOMEWORK SOLUTIONS #8 1. The following code designed and plotted all filters. Plots were generated by my routine “ filter_plot ” that contains code very similar to that presented in the notes. F = [0,0.2,0.3,0.5,0.6,1]; % matlab-normalized frequencies A = [0,0,1,1,0,0]; % desired amplitudes D = [50,0.5,50]; % deviations (in positive dB) M = 1024; % # DFT points to use for DTFT % calculate linear ripple from dB deviations R = zeros(size(D)); for i=1:length(D), if A(2*i)==0, R(i) = 10^(-D(i)/20); % worst stopband ripple else, R(i) = 1-10^(D(i)/20); % worst passband ripple end; end; % calculate smallest transition band width Delta_f = min([-1,1]*reshape(F(2:end-1),2,length(F)/2-1)); Fc = 0.5*[1,1]*reshape(F(2:end-1),2,length(F)/2-1); % design hamming filter L=ceil(3.3/((Delta_f*pi)/(2*pi)))-13; h=fir1(L-1,[1.06*Fc(1),0.975*Fc(2)],hamming(L)); h=h*(1-0.9*R(2)); figure(1) filter_plot(h,1,M,F,A,D); title([’hamming, L=’,num2str(L)]); % design kaiser filter [N,Fk,beta,filt_type] = kaiserord(F(2:end-1),A(1:2:end),abs(R)); L=N-10; h=fir1(L-1,[1.051*Fk(1),0.975*Fk(2)],kaiser(L,1.05*beta)); h=h*(1-0.95*R(2)); figure(2) filter_plot(h,1,M,F,A,D); title([’kaiser, L=’,num2str(L)]); % design WLS filter L=44; h=firls(L-1,[0,0.205,0.310,0.49,0.595,1],A,[1.3/R(1),0.5/R(2),1.1/R(3)]); h=h*(1-0.75*R(2)); figure(3) filter_plot(h,1,M,F,A,D); title([’weighted LS, L=’,num2str(L)]); % design equiripple filter [N,F,A,W]=firpmord(F(2:end-1),A(1:2:end),abs(R)); L=N+7; h=firpm(L-1,F,A,W); figure(4) filter_plot(h,1,M,F,A,D); title([’equiripple, L=’,num2str(L)]); % design butterworth filter [N,fc] = buttord(F(3:4),[F(2),F(5)],2*D(2),D(1)+D(2)); [b,a] = butter(N,fc);...
View Full Document

This note was uploaded on 03/05/2011 for the course ECE 600 taught by Professor Clymer,b during the Fall '08 term at Ohio State.

Page1 / 6

solns8_600(2) - ECE-600 Introduction to Digital Signal...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online