From: Kumar Ishita on
Hii, I have a signal with 5000Hz sampling rate. I have to filter out frequencies b/w 10 to 12 Hz. I need to use bandstop frequency.I tried using sptool by designing the filter I require. once I design the filter and load the signal, when I try to apply another signal is produced, I am not able to understand what this new signal represents. Can any one help me with this?
Also can someone help me with the basic code I need to write for using bandstop filter?
I need the filtered signal w.r.t time as I need to find the area under my filtered signal.
Is there any other approach to use the bandstop filter and obtain the filtered signal?
Thank You.....
From: Wayne King on
"Kumar Ishita" <kumar_ishita86(a)yahoo.com> wrote in message <hovehq$9l2$1(a)fred.mathworks.com>...
> Hii, I have a signal with 5000Hz sampling rate. I have to filter out frequencies b/w 10 to 12 Hz. I need to use bandstop frequency.I tried using sptool by designing the filter I require. once I design the filter and load the signal, when I try to apply another signal is produced, I am not able to understand what this new signal represents. Can any one help me with this?
> Also can someone help me with the basic code I need to write for using bandstop filter?
> I need the filtered signal w.r.t time as I need to find the area under my filtered signal.
> Is there any other approach to use the bandstop filter and obtain the filtered signal?
> Thank You.....

Hi Kumar, I recommend using a filter specification object, and then designing a filter object based on your specification object.

1.) Use fdesign.bandstop() to specify your filter. You can enter your sampling frequency of 5 kHz as a trailing scalar. This will specify your filter in Hz.
2.) invoke the design() method on the filter specification object. Once you specify your filter, you can use designmethods() on the filter specification object to find out what are valid design methods.
3.) apply the filter to your data using filter()

Wayne
From: Kumar Ishita on
Hiii..Thanx again 4 the reply. I tried to design a filter. Using deign command. Once I design the filter,I have to apply this to my data. This is where I am stuck again. I have used h=design(d,'kaiserwin') . But to use filter, I need coefficients b and a, how r they related to the filter I designed. Can you help me? thanx


"Wayne King" <wmkingty(a)gmail.com> wrote in message <hovfnc$qvh$1(a)fred.mathworks.com>...
> "Kumar Ishita" <kumar_ishita86(a)yahoo.com> wrote in message <hovehq$9l2$1(a)fred.mathworks.com>...
> > Hii, I have a signal with 5000Hz sampling rate. I have to filter out frequencies b/w 10 to 12 Hz. I need to use bandstop frequency.I tried using sptool by designing the filter I require. once I design the filter and load the signal, when I try to apply another signal is produced, I am not able to understand what this new signal represents. Can any one help me with this?
> > Also can someone help me with the basic code I need to write for using bandstop filter?
> > I need the filtered signal w.r.t time as I need to find the area under my filtered signal.
> > Is there any other approach to use the bandstop filter and obtain the filtered signal?
> > Thank You.....
>
> Hi Kumar, I recommend using a filter specification object, and then designing a filter object based on your specification object.
>
> 1.) Use fdesign.bandstop() to specify your filter. You can enter your sampling frequency of 5 kHz as a trailing scalar. This will specify your filter in Hz.
> 2.) invoke the design() method on the filter specification object. Once you specify your filter, you can use designmethods() on the filter specification object to find out what are valid design methods.
> 3.) apply the filter to your data using filter()
>
> Wayne
From: Wayne King on
"Kumar Ishita" <kumar_ishita86(a)yahoo.com> wrote in message <hp04h0$5ms$1(a)fred.mathworks.com>...
> Hiii..Thanx again 4 the reply. I tried to design a filter. Using deign command. Once I design the filter,I have to apply this to my data. This is where I am stuck again. I have used h=design(d,'kaiserwin') . But to use filter, I need coefficients b and a, how r they related to the filter I designed. Can you help me? thanx
>
>
> "Wayne King" <wmkingty(a)gmail.com> wrote in message <hovfnc$qvh$1(a)fred.mathworks.com>...
> > "Kumar Ishita" <kumar_ishita86(a)yahoo.com> wrote in message <hovehq$9l2$1(a)fred.mathworks.com>...
> > > Hii, I have a signal with 5000Hz sampling rate. I have to filter out frequencies b/w 10 to 12 Hz. I need to use bandstop frequency.I tried using sptool by designing the filter I require. once I design the filter and load the signal, when I try to apply another signal is produced, I am not able to understand what this new signal represents. Can any one help me with this?
> > > Also can someone help me with the basic code I need to write for using bandstop filter?
> > > I need the filtered signal w.r.t time as I need to find the area under my filtered signal.
> > > Is there any other approach to use the bandstop filter and obtain the filtered signal?
> > > Thank You.....
> >
> > Hi Kumar, I recommend using a filter specification object, and then designing a filter object based on your specification object.
> >
> > 1.) Use fdesign.bandstop() to specify your filter. You can enter your sampling frequency of 5 kHz as a trailing scalar. This will specify your filter in Hz.
> > 2.) invoke the design() method on the filter specification object. Once you specify your filter, you can use designmethods() on the filter specification object to find out what are valid design methods.
> > 3.) apply the filter to your data using filter()
> >
> > Wayne

Hi kumar, if you invoke the design method as

h = design(d,'kaiserwin');

then you can use the object directly in the filter() method to filter your data.

y = filter(h,InputData);

filter() knows how to use filter objects.

Since you used the Kaiser window design method, you have an FIR filter. There is only one denominator coefficient for your filter and that is equal to 1. You have an all-zero filter--only numerator coefficients. If you want to see the coefficients, they are in the object, h.

% not using your specifications, just a default specification
D = fdesign.bandstop;
h = design(D,'kaiserwin');
% plot the impulse response
stem(h.Numerator);
% h.Numerator is the b vector you were looking for


Hope that helps,
Wayne
From: Kumar Ishita on
"Wayne King" <wmkingty(a)gmail.com> wrote in message <hp0jml$2c5$1(a)fred.mathworks.com>...
> "Kumar Ishita" <kumar_ishita86(a)yahoo.com> wrote in message <hp04h0$5ms$1(a)fred.mathworks.com>...
> > Hiii..Thanx again 4 the reply. I tried to design a filter. Using deign command. Once I design the filter,I have to apply this to my data. This is where I am stuck again. I have used h=design(d,'kaiserwin') . But to use filter, I need coefficients b and a, how r they related to the filter I designed. Can you help me? thanx
> >
> >
> > "Wayne King" <wmkingty(a)gmail.com> wrote in message <hovfnc$qvh$1(a)fred.mathworks.com>...
> > > "Kumar Ishita" <kumar_ishita86(a)yahoo.com> wrote in message <hovehq$9l2$1(a)fred.mathworks.com>...
> > > > Hii, I have a signal with 5000Hz sampling rate. I have to filter out frequencies b/w 10 to 12 Hz. I need to use bandstop frequency.I tried using sptool by designing the filter I require. once I design the filter and load the signal, when I try to apply another signal is produced, I am not able to understand what this new signal represents. Can any one help me with this?
> > > > Also can someone help me with the basic code I need to write for using bandstop filter?
> > > > I need the filtered signal w.r.t time as I need to find the area under my filtered signal.
> > > > Is there any other approach to use the bandstop filter and obtain the filtered signal?
> > > > Thank You.....
> > >
> > > Hi Kumar, I recommend using a filter specification object, and then designing a filter object based on your specification object.
> > >
> > > 1.) Use fdesign.bandstop() to specify your filter. You can enter your sampling frequency of 5 kHz as a trailing scalar. This will specify your filter in Hz.
> > > 2.) invoke the design() method on the filter specification object. Once you specify your filter, you can use designmethods() on the filter specification object to find out what are valid design methods.
> > > 3.) apply the filter to your data using filter()
> > >
> > > Wayne
>
> Hi kumar, if you invoke the design method as
>
> h = design(d,'kaiserwin');
>
> then you can use the object directly in the filter() method to filter your data.
>
> y = filter(h,InputData);
>
> filter() knows how to use filter objects.
>
> Since you used the Kaiser window design method, you have an FIR filter. There is only one denominator coefficient for your filter and that is equal to 1. You have an all-zero filter--only numerator coefficients. If you want to see the coefficients, they are in the object, h.
>
> % not using your specifications, just a default specification
> D = fdesign.bandstop;
> h = design(D,'kaiserwin');
> % plot the impulse response
> stem(h.Numerator);
> % h.Numerator is the b vector you were looking for
>
>
> Hope that helps,
> Wayne

Thanx..........that did help me........Thank You