Nonuniform SAmpling FIR

Started by Emhemmed B Limsailkhi January 5, 2001
>Hi .... We are developing a nonuniform frequency sampling FIR digital
filter (lowpass) with linear phase using Matlab5.3 and DSP toolbox (I
dont remember the version of the DSP), however, We have arrived to a
stuck point in the code becouse i am not very pro in Matlab. We have
developed a uniform frequency sampling succefuly as follows:
>%Consider the lowpass filter specifications as follows:
>
>% wp= 0.2 pi, Rp= 0.25 dB
>
>% ws= 0.3 pi, As= 50 dB Which means that Rs=0.00316 dB
>
>%Design an FIR filter using the frequency sampling approach. >%
>
>% (a) 20 samples to have value 1 at 0.2*pi and value 0 at 0.3*pi
>
>% >%Length of the FIR filter
>
>N = 20; >M = (N-1)/2; >Hrs = [1,1,1,zeros(1,15),1,1]; >%Samplimg Points in both Passband and stopband areas
>
>k1 = 0:floor((N-1)/2);
>
>k2 = floor((N-1)/2)+1:N-1; >angH = [-M*(2*pi)/N*k1, M*(2*pi)/N*(N-k2)]; >H = Hrs.*exp(j*angH);
>
>h = real(ifft(H,N)); >[Hr,ww,a,L] = Hr_Type2(h); >plot(ww/pi,Hr);
>
>axis([0,1,-0.2,1.2]);
>
>title('Amplitude Response of Uniform Frequency Sampling Method')
>
>xlabel('frequency in pi units')
>
>ylabel('Hr(w)')
>
>grid >
>/*****the function used here Hr_Type2(h); is as:
>
>%%Linear-phase FIR filter: Symmetrical impulse response M even >
>
>function [Hr,w,b,L] = Hr_Type2(h); >
>% Computes Amplitude response of Type-2 LP FIR filter
>
>% ---------------
>
>% [Hr,w,b,L] = Hr_Type2(h)
>
>% Hr = Amplitude Response
>
>% w = frequencies between [0 pi] over which Hr is computed
>
>% b = Type-2 LP filter coefficients
>
>% L = Order of Hr
>
>% h = Type-2 LP impulse response
>
>% >
>M = length(h);
>
>L = M/2;
>
>b = 2*[h(L:-1:1)];
>
>n = [1:1:L]; n = n-0.5;
>
>w = [0:1:500]'*pi/500;
>
>Hr = cos(w*n)*b'; >***********
>
>so if you can help me to do the same with the nonuniform method i
will be grateful
>
>or even if you can redirect me to a useful URL site which used to
do the help..
>
>
>.
>
>Thanks...
>
>Emhmemmed
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.