I'm not yet well educated on the DSP subject, but I've initiated a project where I will do some audio filtering. My intuition tells me that there is a link between the coefficients of a FIR filter and the response of the audio indicated by values of a fourier transform.

My question; is there a way to go from FFT data to FIR coefficients? What about the other way around?

I apologize that I probably do not use the correct terms. Thank you for any response :)

EDIT: I got a request to make this clearer, so here is some pseudo code of what I want to do given a stream of audio data:

fftdata = fft(stream)
soSomethingTo(fftdata) //for instance increase bass response
FIRcoef = translate(fftdata)
stream = fir(stream, FIRcoef)

So, this would analyze the stream and create a FIR that slightly modifies the fft response.

  • $\begingroup$ When you mention "values of a fourier transform", you mean fourier transform of what exactly? Could you give more detail to your question? $\endgroup$ – bone Nov 19 '15 at 9:35
  • $\begingroup$ edits made, not really sure what I can do to make it clearer? Both an FT and a FIR operates on a signal / stream of discrete values. They would operate on a stream of PCM audio data. :) $\endgroup$ – AlexanderBrevig Nov 19 '15 at 10:00
  • $\begingroup$ If you perform the filtering (such as increasing the bass response) directly in the frequency domain by modifying the FFT sample values, why don't you perform inverse FFT and obtain the stream directly from there? $\endgroup$ – bone Nov 19 '15 at 10:55
  • $\begingroup$ I need the actual filter to be (close to) real time, so I will use a FIR to do the actual filtering. But I want to have a second process update the coefficients to perform some correction on the stream. The actual correction may be more bass, or less bass. I will end up with a FFTerror = FFT(wanted) - FFT(actual), now I need to convert the error to a set of FIR coefs, so I can do mean-squared error update of the current weights. At least this is my current thinking. $\endgroup$ – AlexanderBrevig Nov 19 '15 at 11:07
  • 1
    $\begingroup$ First of all, be carefull with the size of the filter, if it is too long it may be faster to filter by FFT than to perform convolution. But yes your reasoning seems correct, I would just instead of transforming the error, directly antitransform the new FFT filter and get the new FIR coefficients from there. In terms of assembly instructions it will actually be faster to change the values that to perform addition of the error in time domain to your existing coefficients. As for Resources: The book by Oppenheim and Schafer is a good source. $\endgroup$ – bone Nov 19 '15 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.