Hi, I have my FFT/iFFT algorithm working perfectly and I can get my original audio data from time-domain to frequency domain and back. Now I'm ready to start applying filters to the frequency data. I am new to this and would like to know if there are some simple effects I can apply to the frequency data to test the results and get used to messing in this domain before I get into FIR filters and the like. Anything that can tweak the frequency data and get an audible result (echo, reverb, etc.) when I play the new audio. Thank you.
Manipulate frequency data
Started by ●February 7, 2005
Reply by ●February 7, 20052005-02-07
in article 1107827071.911311.162710@z14g2000cwz.googlegroups.com, yeti349@yahoo.com at yeti349@yahoo.com wrote on 02/07/2005 20:44:> Hi, I have my FFT/iFFT algorithm working perfectly and I can get my > original audio data from time-domain to frequency domain and back. Now > I'm ready to start applying filters to the frequency data. I am new to > this and would like to know if there are some simple effects I can > apply to the frequency data to test the results and get used to messing > in this domain before I get into FIR filters and the like. Anything > that can tweak the frequency data and get an audible result (echo, > reverb, etc.) when I play the new audio. Thank you. >i wouldn't do any effects with the FFT/iFFT unless you get real good at understanding the periodic nature of the DFT and deal with it (using overlap -adding of adjacent segments). most good musical effects can be done in the time domain quite nicely. glitch-free time stretching or pitch-shifting might be a good example of when to use frequency-domain processing. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Reply by ●February 7, 20052005-02-07
ok, well eventually I need to apply filters in the frequency domain. I have no interest in musical effects, i simply wanted to apply some sort of modification to the frequency data and get some quick results in the new audio file for testing purposes. Any suggestions?
Reply by ●February 8, 20052005-02-08
in article 1107829665.001267.308890@c13g2000cwb.googlegroups.com, yeti349@yahoo.com at yeti349@yahoo.com wrote on 02/07/2005 21:27:> ok, well eventually I need to apply filters in the frequency domain.your "need" is to do the filtering in the frequency domain?> I have no interest in musical effects,okay. i assumed that "echo, reverb, etc." was for musical effects.> i simply wanted to apply some sort > of modification to the frequency data and get some quick results in the > new audio file for testing purposes. Any suggestions?my only suggestion is, if you're gonna do filtering in the frequency domain, better read up on circular convolution, overlap-add, and overlap-save techniques. you will get clicks or similar, each segment if you don't deal with that. but still, doing a little FIR filtering in the time domain is the quickest way to get quick results that i know of. in either case, designing the filter cefficients is a problem. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Reply by ●February 8, 20052005-02-08
yeti349@yahoo.com wrote:> Hi, I have my FFT/iFFT algorithm working perfectly and I can get my > original audio data from time-domain to frequency domain and back. Now > I'm ready to start applying filters to the frequency data. I am new to > this and would like to know if there are some simple effects I can > apply to the frequency data to test the results and get used to messing > in this domain before I get into FIR filters and the like. Anything > that can tweak the frequency data and get an audible result (echo, > reverb, etc.) when I play the new audio. Thank you. >Be sure to understand overlap/add and overlap/save convolution before proceeding further. This is how you avoid time domain aliasing artifacts (what Robert calls "the periodic nature of the DFT" :-). When you have your FFT filter embedded in a OLA or OLS implementation, it is instructive to design some filters in frequency mode, tweaking the frequency domain samples (inaccurately called "bins"), and then apply the results to long continuously varying sinusoidal sweeps (logarithmic if audio is your bent) to see what happens between the frequency domain samples you can tweak. Surprises abound. Bob -- "Things should be described as simply as possible, but no simpler." A. Einstein
Reply by ●February 8, 20052005-02-08
<yeti349@yahoo.com> wrote in message news:1107827071.911311.162710@z14g2000cwz.googlegroups.com...> Hi, I have my FFT/iFFT algorithm working perfectly and I can get my > original audio data from time-domain to frequency domain and back. Now > I'm ready to start applying filters to the frequency data. I am new to > this and would like to know if there are some simple effects I can > apply to the frequency data to test the results and get used to messing > in this domain before I get into FIR filters and the like. Anything > that can tweak the frequency data and get an audible result (echo, > reverb, etc.) when I play the new audio. Thank you.As has been mentioned by others, echo & reverb can be dealt with in the time domain without needing to enter into the frequency domain. Coincidentally, having just written something very similar, but for use at RF to limit uplink feeds to equalise channel utilisation on a linear satellite transponder, I wrote the following rather rough notes. Be glad to hear from the gurus if I have the right idea. 50% Overlap-Add Constants... FFTLen = 2048 SampleSize = FFTLen / 2 Arrays... Real[0..FFTLen-1] zero padded samples, and result of FFT'd samples Imag[0..FFTLen-1] imag result of FFT'd samples HReal,HImag[0..FFTLen-1] for frequency response and its impulse response LastReal,LastImag[0..SampleSize-1] saved result for overlap-add next iteration Algorithm... For each set of SampleSize samples: o Take samples into Real[0..SampleSize-1] o Real[SampleSize..FFTLen-1] = 0 // zero pad o Take in place real FFT on Real[0..FFTLen-1] into Real,Imag[0..FFTLen-1] // Here is a flat response, you can pop in whatever you like, for my application it will insert a notch at high magnitude signals to limit them to a prescribed limit. Remember to mirror around SampleSize/2! o HReal[0..SampleSize-1]=1 o HImag[0..SampleSize-1]=0 // to get impulse response o Inverse FFT in place HReal,HImag [0..SampleSize-1] // get impulse response centred correctly o Rotate IFFT results in HReal,HImag [0..SampleSize-1] by SampleSize/2 o Apply Hanning window to HReal, HImag [0..SampleSize-1] // Zero pad impulse response o HReal,HImag[SampleSize..FFTLen-1]=0 // Get impulse response into frequency domain o Take in place complex FFT on HReal,HImag [0..FFTLen-1] // Apply filter in frequency domain by multiplication o Perform a complex multiply HReal,HImag by Real,Imag [0..FFTLen-1] leaving results in Real,Imag // Now back to the time domain o Perform inverse FFT on Real,Imag [0..FFTLen-1] // Add in artifacts from last sample o Real, Imag[0..SampleSize-1] += LastReal,LastImag[0..SampleSize-1] // Save new artifacts for next sample o LastReal,LastImag[0..SampleSize-1]=Real,Imag[SampleSize..FFTLen-1] o Send out Real[0..SampleSize-1]
Reply by ●February 8, 20052005-02-08
robert bristow-johnson wrote:> in article 1107829665.001267.308890@c13g2000cwb.googlegroups.com, > yeti349@yahoo.com at yeti349@yahoo.com wrote on 02/07/2005 21:27: > > >>ok, well eventually I need to apply filters in the frequency domain. > > > your "need" is to do the filtering in the frequency domain? > > >>I have no interest in musical effects, > > > okay. i assumed that "echo, reverb, etc." was for musical effects. > > >>i simply wanted to apply some sort >>of modification to the frequency data and get some quick results in the >>new audio file for testing purposes. Any suggestions? > > > my only suggestion is, if you're gonna do filtering in the frequency domain, > better read up on circular convolution, overlap-add, and overlap-save > techniques. you will get clicks or similar, each segment if you don't deal > with that. > > but still, doing a little FIR filtering in the time domain is the quickest > way to get quick results that i know of. in either case, designing the > filter cefficients is a problem.Robert, You gotta wrap your head around where he is. I'm sure he thinks bass boost and low-pass filters work in the frequency domain; they affect frequency response, no? Yeti, The distinction between frequency- and time-domain filters is in the way the calculations are done, not the effect on the signal. Explore http://dspguru.com/ for even more astounding stuff: HowTos, Tricks, bibliographies, and more. Look at Robert's excellent Cookbook: http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●February 8, 20052005-02-08
<yeti349@yahoo.com> wrote in message news:1107829665.001267.308890@c13g2000cwb.googlegroups.com...> ok, well eventually I need to apply filters in the frequency domain. I > have no interest in musical effects, i simply wanted to apply some sort > of modification to the frequency data and get some quick results in the > new audio file for testing purposes. Any suggestions?Well, a really simple (and often poor-sounding) frequency-domain filter is just to set all the FFT values above a certain frequency to zero. That should give you a low-pass filtering effect that is easy to hear. It may also bring up some of the issues r b-j was mentioning.
Reply by ●February 8, 20052005-02-08
When I want to play around I use a trial program called Goldwave. It lets you import your own raw data and manipulate it with all sorts of filters and effects. It also lets you graphically see both the time and frequency domain. You can listen (and see) your changes before and after and save the file in any format you want. It's a good place to start if you don't quite know where you want to end up...before you start writing any code. www.goldwave.com Thomas <yeti349@yahoo.com> wrote in message news:1107829665.001267.308890@c13g2000cwb.googlegroups.com...> ok, well eventually I need to apply filters in the frequency domain. I > have no interest in musical effects, i simply wanted to apply some sort > of modification to the frequency data and get some quick results in the > new audio file for testing purposes. Any suggestions? >
Reply by ●February 8, 20052005-02-08
"Jon Harris" <goldentully@hotmail.com> wrote in message news:36sdjcF55ken6U1@individual.net...> <yeti349@yahoo.com> wrote in message > news:1107829665.001267.308890@c13g2000cwb.googlegroups.com... >> ok, well eventually I need to apply filters in the frequency domain. I >> have no interest in musical effects, i simply wanted to apply some sort >> of modification to the frequency data and get some quick results in the >> new audio file for testing purposes. Any suggestions? > > Well, a really simple (and often poor-sounding) frequency-domain filter is > just > to set all the FFT values above a certain frequency to zero. That should > give > you a low-pass filtering effect that is easy to hear. It may also bring > up some > of the issues r b-j was mentioning. > >Or if you just want to fiddle around you could try inverting the phase of every third frequency sample or a progressive phase shift applied to every nth sample before converting back to time domain - write yourself a genetic algorithm and provide fitness criteria by scoring the effects generated then see what sort of patterns survive in the nth generation - how much free time do you have? Best of luck - Mike .






