Hi all, i have a question on filtering here.apparently my filter plot shows
it can get rid of frequency up to 0.017. here's the code,just cut and
paste.
%--------------------------------------------------------------
Wp = 0.0295;
Ws = 0.0270;
Rp = 1;
Rs = 32;
[N,Wn] = cheb1ord(Wp,Ws,Rp,Rs);
[b,a] = cheby1(N,Rp,Wn,'high');
[h,omega] = freqz(b,a,80);
plot (omega/pi,(abs(h)));grid;
xlabel('\omega/\pi'); ylabel('Magnitude');
title('Type I Chebyshev Highpass Filter');
%--------------------------------------------------------------
but i pass a signal through it and plot the filtered signal, i took the
noisyspeech in a frame,80 samples. do a
y=filter(b,a,noisyspeech_in frame1);
Y=abs(fft(y));
f=f=(0:length(Noi)-1)/2/0.005;
plot(f,Y)
it still shows components between 0 to 60Hz. Why is this so??
filtering question
Started by ●May 20, 2006
Reply by ●May 20, 20062006-05-20
>Hi all, i have a question on filtering here.apparently my filter plotshows>it can get rid of frequency up to 0.017. here's the code,just cut and >paste. > >%-------------------------------------------------------------- >Wp = 0.0295; >Ws = 0.0270; >Rp = 1; >Rs = 32; >[N,Wn] = cheb1ord(Wp,Ws,Rp,Rs); >[b,a] = cheby1(N,Rp,Wn,'high'); > [h,omega] = freqz(b,a,80); > plot (omega/pi,(abs(h)));grid; > xlabel('\omega/\pi'); ylabel('Magnitude'); > title('Type I Chebyshev Highpass Filter'); >%-------------------------------------------------------------- >but i pass a signal through it and plot the filtered signal, i took the >noisyspeech in a frame,80 samples. do a > >y=filter(b,a,noisyspeech_in frame1); >Y=abs(fft(y)); >f=f=(0:length(Noi)-1)/2/0.005; >plot(f,Y) > >it still shows components between 0 to 60Hz. Why is this so?? > > >sorry, it should be length(Y) instead of length(Noi)
Reply by ●May 20, 20062006-05-20
>Hi all, i have a question on filtering here.apparently my filter plotshows>it can get rid of frequency up to 0.017. > >it still shows components between 0 to 60Hz. Why is this so??Hi, Maybe you should not look at it with two different frequency scales. Your plot of the filter characteristic is on a normalized frequency scale. So if you plot both with normalized frequency scale, you will see that it works as expected. gr. Anton
Reply by ●May 21, 20062006-05-21
>>Hi all, i have a question on filtering here.apparently my filter plot >shows >>it can get rid of frequency up to 0.017. >> >>it still shows components between 0 to 60Hz. Why is this so?? > >Hi, > >Maybe you should not look at it with two different frequency scales. >Your plot of the filter characteristic is on a normalized frequency >scale. >So if you plot both with normalized frequency >scale, you will see that it works as expected. > >gr. >Anton > > > >oh gosh, now i tried to run my filter again and it is not zero at 0.017 anymore. Does the filter differ in every run? I tried putting Ws=0.019 and Wp=0.0225, to achieve my objective of having zero component at 0.017 but the lower cutoff does not change at all! It remains below 0.017. Did i do something wrong? Moreover,i have tried to plot them on the same scale but there is still some coponent at 0. Why cant i get rid of them? Thanks for your help.
Reply by ●May 21, 20062006-05-21
"doggie" <elusivetruelove2003@yahoo.com> wrote in message news:l6idnRp1OsyT3fLZRVn-tg@giganews.com...> Hi all, i have a question on filtering here.apparently my filter plot > shows > it can get rid of frequency up to 0.017. here's the code,just cut and > paste. > > %-------------------------------------------------------------- > Wp = 0.0295; > Ws = 0.0270; > Rp = 1; > Rs = 32; > [N,Wn] = cheb1ord(Wp,Ws,Rp,Rs); > [b,a] = cheby1(N,Rp,Wn,'high'); > [h,omega] = freqz(b,a,80); > plot (omega/pi,(abs(h)));grid; > xlabel('\omega/\pi'); ylabel('Magnitude'); > title('Type I Chebyshev Highpass Filter'); > %-------------------------------------------------------------- > but i pass a signal through it and plot the filtered signal, i took the > noisyspeech in a frame,80 samples. do a > > y=filter(b,a,noisyspeech_in frame1); > Y=abs(fft(y)); > f=f=(0:length(Noi)-1)/2/0.005; > plot(f,Y) > > it still shows components between 0 to 60Hz. Why is this so??I wonder if the problem might be that 80 samples is too short to get such fine frequency resolution in the result? Fred
Reply by ●May 21, 20062006-05-21
Hi, Of course I don't have your testfile, but I gave it a short look. I tested the filter with white noise (1024 samples). But with a much shorter length (like 50 samples), I don't get a good result. gr. Anton
Reply by ●May 22, 20062006-05-22
>Hi, > >Of course I don't have your testfile, but I gave it a >short look. I tested the filter with white noise (1024 samples). >But with a much shorter length (like 50 samples), I don't get >a good result. > >gr. >Anton > >Hi,what i'm trying to do is to filter each frame of speech (10ms) so that there is no more dc component and 60Hz hum. This will ensure i will measure the correct zero crossing rate subsequently. So what do you suggest i do? If i filter the whole length of speech instead, the individual frame might not have zero dc and 60 hz component. Pls advise.
Reply by ●May 22, 20062006-05-22
"doggie" <elusivetruelove2003@yahoo.com> wrote in message news:-NSdnTMEXsWVzezZnZ2dneKdnZydnZ2d@giganews.com...> >Hi, >> >>Of course I don't have your testfile, but I gave it a >>short look. I tested the filter with white noise (1024 samples). >>But with a much shorter length (like 50 samples), I don't get >>a good result. >> >>gr. >>Anton >> >> > > Hi,what i'm trying to do is to filter each frame of speech (10ms) so that > there is no more dc component and 60Hz hum. This will ensure i will > measure the correct zero crossing rate subsequently. So what do you > suggest i do? If i filter the whole length of speech instead, the > individual frame might not have zero dc and 60 hz component. Pls advise.to get 60Hz resolution you need 1/60 secs long filter. To get a 60Hz highpass with sharper (say 1Hz) transition, you need a filter that is 1 second long. Then, using either filter, there is a transient response that is as long as the filter - so you don't get the steady state response unless you process data that is longer.... Fred
Reply by ●May 22, 20062006-05-22
> >"doggie" <elusivetruelove2003@yahoo.com> wrote in message >news:-NSdnTMEXsWVzezZnZ2dneKdnZydnZ2d@giganews.com... >> >Hi, >>> >>>Of course I don't have your testfile, but I gave it a >>>short look. I tested the filter with white noise (1024 samples). >>>But with a much shorter length (like 50 samples), I don't get >>>a good result. >>> >>>gr. >>>Anton >>> >>> >> >> Hi,what i'm trying to do is to filter each frame of speech (10ms) sothat>> there is no more dc component and 60Hz hum. This will ensure i will >> measure the correct zero crossing rate subsequently. So what do you >> suggest i do? If i filter the whole length of speech instead, the >> individual frame might not have zero dc and 60 hz component. Plsadvise.> >to get 60Hz resolution you need 1/60 secs long filter. > >To get a 60Hz highpass with sharper (say 1Hz) transition, you need afilter>that is 1 second long. > >Then, using either filter, there is a transient response that is as longas>the filter - so you don't get the steady state response unless youprocess>data that is longer.... > >Fred > > >ok..but i can't increase the length of my speech frame if not the short term stationery theory may not stand. What should i do? Im being stuck at this step for so long. My main aim is just to get rid of dc component and 50/60 Hz hum so i can calculate zero crossing rate accurately. I tried filtering the whole length of speech but when seperated into individual frames, it still has dc and 60Hz components so i have to do it frame by frame. By the way, we cant get rid of these components completely,can we? Please advise what filter i should use as im really not strong in filter design. I just need to get over this part and my algorithm will be complete. Thanks for the advices.
Reply by ●May 22, 20062006-05-22
doggie wrote:> > ok..but i can't increase the length of my speech frame if not the short > term stationery theory may not stand. What should i do? Im being stuck at > this step for so long. My main aim is just to get rid of dc component and > 50/60 Hz hum so i can calculate zero crossing rate accurately. I tried > filtering the whole length of speech but when seperated into individual > frames, it still has dc and 60Hz components so i have to do it frame by > frame. >If the filtering of the "whole length" did the job then the existence of those frequencies in the frame is simply an artifact of chunking it up into frames. Your "calculate zero crossing rate accurately" will be similarly affected - moving a frame just a little could easily change the number of zero crossings per frame. All this means is that the frame boundaries are chosen in some arbitrary manner that has no direct relationship to the content of the signal. Just out of curiosity what does an accurate measurement of zero crossings per frame tell you about a speech record? Pardon if you've already explained it I haven't been following closely. -jim> By the way, we cant get rid of these components completely,can we? > > Please advise what filter i should use as im really not strong in filter > design. I just need to get over this part and my algorithm will be > complete. Thanks for the advices.----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption =----






