DSPRelated.com
Forums

How to perform filtering on a time window for an audio signal?

Started by dingke1980 April 11, 2007
For example, for a given 10s length audio signal. I want to perform LP
filter from 3s to 5s time window. At the same time, the total sample
number should remain the same with the un-processed one. Who can tell me
how to do it?


Thx very much.
Kevin


_____________________________________
Do you know a company who employs DSP engineers?  
Is it already listed at http://dsprelated.com/employers.php ?
On Apr 11, 10:29 am, "dingke1980" <dingke1...@hotmail.com> wrote:
> For example, for a given 10s length audio signal. I want to perform LP > filter from 3s to 5s time window. At the same time, the total sample > number should remain the same with the un-processed one. Who can tell me > how to do it? > > Thx very much. > Kevin > > _____________________________________ > Do you know a company who employs DSP engineers? > Is it already listed athttp://dsprelated.com/employers.php?
I can. Anyone else? Dirk
Lets call your signal x.

Extract the signal from 3s to 5s (call it y).
Padd y with zeros and subtract x from y:

z= x - ypad   (where ypad is y padded to be equal in length with x).

Filter y (call it yf) and add it to z to get the final result:


Signal= z + yf



On Apr 11, 9:29 am, "dingke1980" <dingke1...@hotmail.com> wrote:
> For example, for a given 10s length audio signal. I want to perform LP > filter from 3s to 5s time window. At the same time, the total sample > number should remain the same with the un-processed one. Who can tell me > how to do it? > > Thx very much. > Kevin > > _____________________________________ > Do you know a company who employs DSP engineers? > Is it already listed athttp://dsprelated.com/employers.php?
On Apr 11, 10:54 am, "Ikaro" <ikarosi...@hotmail.com> wrote:
> Lets call your signal x. > > Extract the signal from 3s to 5s (call it y). > Padd y with zeros and subtract x from y: > > z= x - ypad (where ypad is y padded to be equal in length with x). > > Filter y (call it yf) and add it to z to get the final result: > > Signal= z + yf > > On Apr 11, 9:29 am, "dingke1980" <dingke1...@hotmail.com> wrote: > > > > > For example, for a given 10s length audio signal. I want to perform LP > > filter from 3s to 5s time window. At the same time, the total sample > > number should remain the same with the un-processed one. Who can tell me > > how to do it? > > > Thx very much. > > Kevin > > > _____________________________________ > > Do you know a company who employs DSP engineers? > > Is it already listed athttp://dsprelated.com/employers.php?- Hide quoted text - > > - Show quoted text -
It appears that 'z' is 'x' with data from 3-5 seconds zeroed out, and 'y' is 'x' with data outside 3-5 seconds zeroed out. Then you filter 'z' and add it back to 'y' to get 'Signal'. Questions: 1) Wouldn't you want to be able to use data from outside 3 to 5 seconds to generate the filtered version of the original signal corresponding to 3 to 5 seconds? 2) Wouldn't you want to remove any filter delay so the results that you add are time aligned? Dirk
Thx very much for you reply.

From your method, the filtered signal will have frequency discontinuity at
the 3s and 5s boundary. This is not the stuff I really want. I want to make
the boundary smooth between filtered area and un-filtered area.

If you are using cooledit, you can select the time window signal and use
the tool tp perform filtering from menu: "Transform->Filters->Quick
Filters...". It won't add new samples during filtering. At the same time
the samples will not change out of the desired filtered area.

Do you have any comments and method?

Thanks
Kevin



> >Lets call your signal x. > >Extract the signal from 3s to 5s (call it y). >Padd y with zeros and subtract x from y: > >z= x - ypad (where ypad is y padded to be equal in length with x). > >Filter y (call it yf) and add it to z to get the final result: > > >Signal= z + yf > > > >On Apr 11, 9:29 am, "dingke1980" <dingke1...@hotmail.com> wrote: >> For example, for a given 10s length audio signal. I want to perform LP >> filter from 3s to 5s time window. At the same time, the total sample >> number should remain the same with the un-processed one. Who can tell
me
>> how to do it? >> >> Thx very much. >> Kevin >> >> _____________________________________ >> Do you know a company who employs DSP engineers? >> Is it already listed athttp://dsprelated.com/employers.php? > > >
_____________________________________ Do you know a company who employs DSP engineers? Is it already listed at http://dsprelated.com/employers.php ?
On Apr 11, 11:46 am, "dbell" <bellda2...@cox.net> wrote:
> On Apr 11, 10:54 am, "Ikaro" <ikarosi...@hotmail.com> wrote: > > > > > > > Lets call your signal x. > > > Extract the signal from 3s to 5s (call it y). > > Padd y with zeros and subtract x from y: > > > z= x - ypad (where ypad is y padded to be equal in length with x). > > > Filter y (call it yf) and add it to z to get the final result: > > > Signal= z + yf > > > On Apr 11, 9:29 am, "dingke1980" <dingke1...@hotmail.com> wrote: > > > > For example, for a given 10s length audio signal. I want to perform LP > > > filter from 3s to 5s time window. At the same time, the total sample > > > number should remain the same with the un-processed one. Who can tell me > > > how to do it? > > > > Thx very much. > > > Kevin > > > > _____________________________________ > > > Do you know a company who employs DSP engineers? > > > Is it already listed athttp://dsprelated.com/employers.php?-Hide quoted text - > > > - Show quoted text - > > It appears that > 'z' is 'x' with data from 3-5 seconds zeroed out, and > 'y' is 'x' with data outside 3-5 seconds zeroed out. > > Then you filter 'z' and add it back to 'y' to get 'Signal'. > > Questions: > 1) Wouldn't you want to be able to use data from outside 3 to 5 > seconds to generate the filtered version of the original signal > corresponding to 3 to 5 seconds? > 2) Wouldn't you want to remove any filter delay so the results that > you add are time aligned? > > Dirk- Hide quoted text - > > - Show quoted text -
Sorry, typos (god I hate that), I'll try again: It appears that 'z' is 'x' with data from 3-5 seconds zeroed out, and 'y' is 'x' with data outside 3-5 seconds zeroed out. Then you filter 'y' and add it back to 'z' to get 'Signal'. (TYPOS WERE HERE) Questions: 1) Wouldn't you want to be able to use data from outside 3 to 5 seconds to generate the filtered version of the original signal corresponding to 3 to 5 seconds? 2) Wouldn't you want to remove any filter delay so the results that you add are time aligned? Dirk
>On Apr 11, 11:46 am, "dbell" <bellda2...@cox.net> wrote: >> On Apr 11, 10:54 am, "Ikaro" <ikarosi...@hotmail.com> wrote: >> >> >> >> >> >> > Lets call your signal x. >> >> > Extract the signal from 3s to 5s (call it y). >> > Padd y with zeros and subtract x from y: >> >> > z= x - ypad (where ypad is y padded to be equal in length with x). >> >> > Filter y (call it yf) and add it to z to get the final result: >> >> > Signal= z + yf >> >> > On Apr 11, 9:29 am, "dingke1980" <dingke1...@hotmail.com> wrote: >> >> > > For example, for a given 10s length audio signal. I want to perform
LP
>> > > filter from 3s to 5s time window. At the same time, the total
sample
>> > > number should remain the same with the un-processed one. Who can
tell me
>> > > how to do it? >> >> > > Thx very much. >> > > Kevin >> >> > > _____________________________________ >> > > Do you know a company who employs DSP engineers? >> > > Is it already listed athttp://dsprelated.com/employers.php?-Hide
quoted text -
>> >> > - Show quoted text - >> >> It appears that >> 'z' is 'x' with data from 3-5 seconds zeroed out, and >> 'y' is 'x' with data outside 3-5 seconds zeroed out. >> >> Then you filter 'z' and add it back to 'y' to get 'Signal'. >> >> Questions: >> 1) Wouldn't you want to be able to use data from outside 3 to 5 >> seconds to generate the filtered version of the original signal >> corresponding to 3 to 5 seconds? >> 2) Wouldn't you want to remove any filter delay so the results that >> you add are time aligned? >> >> Dirk- Hide quoted text - >> >> - Show quoted text - > >Sorry, typos (god I hate that), I'll try again: > >It appears that >'z' is 'x' with data from 3-5 seconds zeroed out, and >'y' is 'x' with data outside 3-5 seconds zeroed out. > >Then you filter 'y' and add it back to 'z' to get 'Signal'. (TYPOS >WERE HERE) > >Questions: >1) Wouldn't you want to be able to use data from outside 3 to 5 >seconds to generate the filtered version of the original signal >corresponding to 3 to 5 seconds? >2) Wouldn't you want to remove any filter delay so the results that >you add are time aligned? > >Dirk > >
As I said in the previous reply, I just want to implement the function like cooledit does to perform filtering on part of the audio signal. The requirement is: (1)Not generate new sample due to the filtering. (2) Should frequency smoothing b/t the boundary. (3) Don't change the value outside the time window. Could you help me? Thanks Ke _____________________________________ Do you know a company who employs DSP engineers? Is it already listed at http://dsprelated.com/employers.php ?
On Apr 11, 12:02 pm, "dingke1980" <dingke1...@hotmail.com> wrote:
> >On Apr 11, 11:46 am, "dbell" <bellda2...@cox.net> wrote: > >> On Apr 11, 10:54 am, "Ikaro" <ikarosi...@hotmail.com> wrote: > > >> > Lets call your signal x. > > >> > Extract the signal from 3s to 5s (call it y). > >> > Padd y with zeros and subtract x from y: > > >> > z= x - ypad (where ypad is y padded to be equal in length with x). > > >> > Filter y (call it yf) and add it to z to get the final result: > > >> > Signal= z + yf > > >> > On Apr 11, 9:29 am, "dingke1980" <dingke1...@hotmail.com> wrote: > > >> > > For example, for a given 10s length audio signal. I want to perform > LP > >> > > filter from 3s to 5s time window. At the same time, the total > sample > >> > > number should remain the same with the un-processed one. Who can > tell me > >> > > how to do it? > > >> > > Thx very much. > >> > > Kevin > > >> > > _____________________________________ > >> > > Do you know a company who employs DSP engineers? > >> > > Is it already listed athttp://dsprelated.com/employers.php?-Hide > quoted text - > > >> > - Show quoted text - > > >> It appears that > >> 'z' is 'x' with data from 3-5 seconds zeroed out, and > >> 'y' is 'x' with data outside 3-5 seconds zeroed out. > > >> Then you filter 'z' and add it back to 'y' to get 'Signal'. > > >> Questions: > >> 1) Wouldn't you want to be able to use data from outside 3 to 5 > >> seconds to generate the filtered version of the original signal > >> corresponding to 3 to 5 seconds? > >> 2) Wouldn't you want to remove any filter delay so the results that > >> you add are time aligned? > > >> Dirk- Hide quoted text - > > >> - Show quoted text - > > >Sorry, typos (god I hate that), I'll try again: > > >It appears that > >'z' is 'x' with data from 3-5 seconds zeroed out, and > >'y' is 'x' with data outside 3-5 seconds zeroed out. > > >Then you filter 'y' and add it back to 'z' to get 'Signal'. (TYPOS > >WERE HERE) > > >Questions: > >1) Wouldn't you want to be able to use data from outside 3 to 5 > >seconds to generate the filtered version of the original signal > >corresponding to 3 to 5 seconds? > >2) Wouldn't you want to remove any filter delay so the results that > >you add are time aligned? > > >Dirk > > As I said in the previous reply, I just want to implement the function > like cooledit does to perform filtering on part of the audio signal. The > requirement is: (1)Not generate new sample due to the filtering. (2) > Should frequency smoothing b/t the boundary. (3) Don't change the value > outside the time window. > > Could you help me? >
are clicks a problem? you might want to consider some graceful ramping at the beginning and end of your selection (i would not call that a "window", not yet). r b-j
> Questions: > 1) Wouldn't you want to be able to use data from outside 3 to 5 > seconds to generate the filtered version of the original signal > corresponding to 3 to 5 seconds?
Sure that's another way to do it. But you would have to make sure that the output of the filter is cropped to the same length of the 3-5 s signal. Alternatively you could also set the initial conditions of the filter.
> 2) Wouldn't you want to remove any filter delay so the results that > you add are time aligned?
Yes that is correct
On Apr 11, 12:02 pm, "dingke1980" <dingke1...@hotmail.com> wrote:
> >On Apr 11, 11:46 am, "dbell" <bellda2...@cox.net> wrote: > >> On Apr 11, 10:54 am, "Ikaro" <ikarosi...@hotmail.com> wrote: > > >> > Lets call your signal x. > > >> > Extract the signal from 3s to 5s (call it y). > >> > Padd y with zeros and subtract x from y: > > >> > z= x - ypad (where ypad is y padded to be equal in length with x). > > >> > Filter y (call it yf) and add it to z to get the final result: > > >> > Signal= z + yf > > >> > On Apr 11, 9:29 am, "dingke1980" <dingke1...@hotmail.com> wrote: > > >> > > For example, for a given 10s length audio signal. I want to perform > LP > >> > > filter from 3s to 5s time window. At the same time, the total > sample > >> > > number should remain the same with the un-processed one. Who can > tell me > >> > > how to do it? > > >> > > Thx very much. > >> > > Kevin > > >> > > _____________________________________ > >> > > Do you know a company who employs DSP engineers? > >> > > Is it already listed athttp://dsprelated.com/employers.php?-Hide > quoted text - > > >> > - Show quoted text - > > >> It appears that > >> 'z' is 'x' with data from 3-5 seconds zeroed out, and > >> 'y' is 'x' with data outside 3-5 seconds zeroed out. > > >> Then you filter 'z' and add it back to 'y' to get 'Signal'. > > >> Questions: > >> 1) Wouldn't you want to be able to use data from outside 3 to 5 > >> seconds to generate the filtered version of the original signal > >> corresponding to 3 to 5 seconds? > >> 2) Wouldn't you want to remove any filter delay so the results that > >> you add are time aligned? > > >> Dirk- Hide quoted text - > > >> - Show quoted text - > > >Sorry, typos (god I hate that), I'll try again: > > >It appears that > >'z' is 'x' with data from 3-5 seconds zeroed out, and > >'y' is 'x' with data outside 3-5 seconds zeroed out. > > >Then you filter 'y' and add it back to 'z' to get 'Signal'. (TYPOS > >WERE HERE) > > >Questions: > >1) Wouldn't you want to be able to use data from outside 3 to 5 > >seconds to generate the filtered version of the original signal > >corresponding to 3 to 5 seconds? > >2) Wouldn't you want to remove any filter delay so the results that > >you add are time aligned? > > >Dirk > > As I said in the previous reply, I just want to implement the function > like cooledit does to perform filtering on part of the audio signal. The > requirement is: (1)Not generate new sample due to the filtering. (2) > Should frequency smoothing b/t the boundary. (3) Don't change the value > outside the time window. > > Could you help me? > > Thanks > Ke > > _____________________________________ > Do you know a company who employs DSP engineers? > Is it already listed athttp://dsprelated.com/employers.php?- Hide quoted text - > > - Show quoted text -
Ke, If you are really happy with what CoolEdit is doing, you should develop a few simple experiments to find out EXACTLY what CoolEdit is doing, and do the same. It might save you from reinventing the wheel. Decide what questions you need answered and design CoolEdit input test signals appropriately to get the results you need. Dirk