3
$\begingroup$

I have created a set of spectral processing modules for SynthEdit next to be released, implenting short time fft, so I am now quite experienced with the matter, but recently encounteted an unexpected problem which looks more thorny than it seemed at first glance: noise generation in frequency domain. I had this idea of adding a module to generate white noise fft frames, so that when one needs to inject a noise source in the spectral.process chain, he can avoid to waste cpu with a noise generator plus dedicated FFT. Well things seemed simple: just generate spectral frames made of random bins (each bin containing random real and imaginary parts ranging -k / +k where k is a suitable scaling factor for having a more or less normalized output level after IFFT). Well I encountered an unexpected problem: the resulting white noise (after IFFT) has a clearly audible periodicity whose length is the lenght of the fft frame size chosen. After careful investigation I realized that this was unfortunately the obvious and expectable behaviour, and that generating white noise by ifft is likely going to be a much more challenging task than one could expect. I try to explain why (keep im mind that I am a skilled coder and quite experienced with maths but not to the point of treating the matter with too advanced maths as it is often the case here, so bear patience). Simply said, by proceeding the way I just explained, you end up creating discontinuities between subsequent frames which are clearly audible. Mainly because a fft frame has a non null.lenght and therefore contains temporal information other than merely spectral information. Consider the extreme case of a white noise band-limited to a single bin frequency: the first frame will have that component with a random magnitude of say 1 and random phase of pi/2. In the next frame you may have a random magnitude of .2 and random phase of 4/5 pi. You have a discontinuity between frames, periods. And even if the global signal is composed of many frequencies of random magnitudes and phases, every single frequency will experience a discontinuity at the next frame, which will be globally audible as a white noise with periodic jumps. I searched for other threads here (very few) where the matter of generating white noise in frequency domain is addressed, but this big problem is never mentioned. I could not find an easy solution yet. If somebody may have one he is welcome and I thank him in advance. Thanks

Actually I discovered the reason for the periodic pattern is much simpler. When you operate STFT processing with overlapping windows on a time domain signal, the overlapping parts represent a same common portion of the input signal. But if I am synthesizing white noise by generating random spectral frames, the overlapping parts after inverse fft will contain DIFFERENT data, therefore some amount of phase cancellation occurs and the COLA windows will stop work as intended,.because things cannot sum up.linearly any longer. This is a hard to solve problem. One should be able to synthesize spectral frames in such a way that the first half after ifft contains the same signal of the second half of the previous frame, all done remaining inside frequency domain. The only way to achieve that would be splitting fft frames and recombining, all operations which to the best of my knowledge can only be achieved by framesize-long convolutions in frequency domain. Therefore I came to the conclusion that synthesizing white noise in a stft context using overlapping windows is a lost battle. It is very strange, I repeat, that this fact has never been addressed by any author AFAIK and I am also a bit disappointed for not receiving any feedback here.

$\endgroup$

1 Answer 1

1
$\begingroup$

It is totally possible to generate perfect white noise in the frequency domain, it's just your approach that is wrong. By definition white noise contains all frequencies at equal levels. To produce this in the frequency domain you just need a flat line for the magnitude. The line's value is your level. Then you generate a phase frame filled with random values between -pi and +pi. Every frame you need to generate a new set of random values obviously. Convert that to cartesian, then resynthesise using STFT with overlapping windows - done!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.