Welcome, Guest. Please login or register.

Author Topic: Is this feasable?  (Read 3984 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Wittgenstein

  • Newbie
  • *
  • Join Date: May 2002
  • Posts: 39
    • Show all replies
Re: Is this feasable?
« on: July 13, 2003, 10:16:42 PM »
Quote
I started thinking. If you split a sample into windows and analyse each window with a fourier transform to identify the regions containing the most frequencies, could that not be used to program the FIR filter automatically?


Well, the problems with the discrete Fourier transform of a discrete signal is that it is in fact a Fourier series of the periodic expansion of the signal. This means that if you just take a window and chop of the signal on both sides of that window you will get lots of ripples and smearing. The chopping can be seen as a multiplication with a box in the time domain and hence a convolution with a sinc  in the frequency domain (the ripples and smearing comes from this convolution).

The easiest way to get a better resolution is to multiply with some other kind of waveform (instead of the box). Examples of such waveforms are a raised cosine (a "bump")  or a Blackman window (available in MATLAB).

Quote
Overlap the windows and gradually modify the FIR response curve and you might get a very nice adaptive noise filter for samples...


I am not 100% sure what you mean by "gradually modify" the FIR-filter. Can you elaborate?

Quote
Has anybody here done anything like this already?


Im not sure about the filtering stuff, but this kind of approach is central in spectral analysis so the theory is probably available somewhere....

/W
Backworld /  Current 93 / Death in June / Fire + Ice /  Sol Invictus / TMLHBAC
 

Offline Wittgenstein

  • Newbie
  • *
  • Join Date: May 2002
  • Posts: 39
    • Show all replies
Re: Is this feasable?
« Reply #1 on: July 14, 2003, 01:21:04 AM »
Quote
What I meant by modifying the FIR filter was calculating the coefficeints based on each unique window - ie each window is filtered seperately based on the low and high frequency limits determined by the FT analysis of that window.


Ok, but how do you calculate the limits? If I understand you correctly, you have some kind of bandpass filter and the cut off frequencies depends on the signal. In what way? Do you want the band to be as narrow as possible to remove as much noise as possible or is there another reason?

Quote

I also imagined that to avoid sharp changes in the filtering across windows, the windows could be overlapped say 50 % with a crossfading function of some sort.

Ie window 0 is from sample 0 - 1000, window 1 is from 500 to 1500, window 2 is from 1000-2000 and so on.


It doesnt matter that they overlapp. You will still lose resolution because of fewer samples but you will gain "better" parameters.

This sounds like an interesting problem, but before I can do some calculations I need more information. I need the assumptions you have made, that is, what kind of signal and noise you have and how you calculate your parameters.

One interesting question is how the optimal number and size of window will look (1 window, 10 windows, 100 windows with or without overlapp). Using several windows will probably be better if the signal has a limited bandwidth which is not fixed (it is moving around in the frequency domain).

/W
Backworld /  Current 93 / Death in June / Fire + Ice /  Sol Invictus / TMLHBAC
 

Offline Wittgenstein

  • Newbie
  • *
  • Join Date: May 2002
  • Posts: 39
    • Show all replies
Re: Is this feasable?
« Reply #2 on: July 16, 2003, 12:24:23 AM »
Quote
My basic assumptions were as follows
1) We analyse a window of sound to get the frequency spectrum for that window.

2) We identify the lowest and highest frequencies for which the intensity (contribution to the overall signal strength) is greater than a threshold set by the user.

3) We use those frequencies as the limits to build an FIR filter and process the original window samples to eliminate as much of those frequencies above and below as possible.


Ok, all those points are more or less straight forward, so I add two other points that must be considred.

2a) Decide (in some way) the number and size of the windows.

4) Develop some kind of method to change the parameters of the filter as a function of time (position). This is probably the hardest part and it depends on the windowing technique we want to use. It is important that the filter parameters doesnt change too much (highly nonlinear filters can give rise to unwanted results).

To test the method we could skip point (2a) and fix the number and size of the windows but to get a good and robust method we probably need to find some kind of (local) maximum of the number and size of the windows (we need at least know that the specific size and number works for the data).

I would love to do some calculations on this, but Im leaving for vacation tomorrow and I will be back in about 2 weeks. If you are still interested we can continue our discussion then and I can do some basic analysis (if someone else hasnt already done it by then).

Good luck and if you get any results, please post them here (or pmail them to me).

/W
Backworld /  Current 93 / Death in June / Fire + Ice /  Sol Invictus / TMLHBAC
 

Offline Wittgenstein

  • Newbie
  • *
  • Join Date: May 2002
  • Posts: 39
    • Show all replies
Re: Is this feasable?
« Reply #3 on: July 16, 2003, 12:47:23 AM »
Quote
I was planing to cheat on this part by using overlapping windows and a crossfade

So each window is discretely analysed and filtered as a finite sample. The output has a fade in (beginning to centre) and fade out (centre to end) volume envelope applied and is mixed from the middle point of the previous output.

The fade out of the previous output window will thus overlap with the fade in of the current one (the 50% overlap I mentioned earlier).

This way we remove the complexity of a true time dependent filter and approximate the desired effect.


Think about this case: If you have a signal with frequency f_1 in the first window and in the directly following window a signal with frequence f_2, with f_1>f_2 (that is, two simple sine waves).

If you use the old method you will get a filter that have a turn on frequency less than f_1 and turn off frequency greater than f_2 (you will hear both signals after the filtering).

If you instead use the new method, you will get two filters, the first one will only allow frequencies around f_1 to pass and the second one will only allow frequencies around f_2 to pass. If you now do a cross fade you will hear both tones equally bright around the moment you switch window. Hence, the result will not be the same as in the first case.

If I understand you correctly, you want the result to be as close to the first case as possible so we must deal with this in some way. This problem will probably arise as soon as the filter completely changes between the windows. If the filter only changes a "little" you will probably not hear the change. This also shows that point 4 (the problem with changing the parameters) and point 2a (the problem with choosing the windows) are in fact closely related...


/W
Backworld /  Current 93 / Death in June / Fire + Ice /  Sol Invictus / TMLHBAC
 

Offline Wittgenstein

  • Newbie
  • *
  • Join Date: May 2002
  • Posts: 39
    • Show all replies
Re: Is this feasable?
« Reply #4 on: July 16, 2003, 01:34:15 AM »
Quote
The effect is that the output just begins to pass f2 at 500 and just begins to reject f1 at 1000. The transition is gradual. In reality the degree of 'gating' would be user selectable.


Ok, it might work but I am still not 100% sure. The best way is probably to test it :)

Quote
For the example you set, a non overlapping filter would be perfect since we are dealing with a very specific case of 2 frequencies that change exactly on a window border.


Well, it is the simplies case. If we have two spectras that are overlapping and still have completely different filter you will get another result than the ordinary method. For example, at sample 749, you will get 50% of the signal filtered with a filter using the info of the first window, and 50% of the signal filtered with a filter using the info of the second window (that is the window from smaple 500 to 1499).

But I dont have any alternative method so it can be a good starting point to try it out.

/W
Backworld /  Current 93 / Death in June / Fire + Ice /  Sol Invictus / TMLHBAC
 

Offline Wittgenstein

  • Newbie
  • *
  • Join Date: May 2002
  • Posts: 39
    • Show all replies
Re: Is this feasable?
« Reply #5 on: July 16, 2003, 12:05:21 PM »
Quote

Well yes, but sample 749 (f1) will a mix of 50% from a filter that passes f1 and a 50% from filter that passes both f1 and f2 (however there is no f2 present at this position yet)

So hopefully you'll still get 100% of f1 through at this point
 


Yeah, but I was thinking more generaly now... If the spectras overlap and have different filters you will get something strange (50% from the output of filter 1 and 50% from the output of filter 2).

/W
Backworld /  Current 93 / Death in June / Fire + Ice /  Sol Invictus / TMLHBAC