Producing Waveform from Frequency Table

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 replies · 2K views
navaburo
Messages
6
Reaction score
0
I'm working on a voice synthesizer. I have my computer set up to accept an 8-bit 44kHz waveform. I'm feeding it sines, adding sines together, and so on. It works great.

However, I want to generate a sound given a frequency histogram. That is, I want to generate noise that has a specific frequency distribution. If my frequency table is stored in an array (think "int freq[100]", using 100Hz histogram bins), how would I go about obtaining a waveform? (I have tried just adding a bunch of sines together, but this doesn't seem to work well... I get lots of beating, not at all a regular "noise" as I want).

Thanks a bunch!
Chris
 
on Phys.org
To accurately reproduce a sound from its frequency spectrum, you need not only the amplitudes at each frequency, but also the phases.

(There is an algorithm called "inverse Fourier transform" that can create the waveform for you, but all it does is adds sine waves in a computationally efficient way.)

Possible other causes of problem:

Is 100 Hz resolution good enough?
Are you using amplitude ("volts") which is correct, or power ("watts") or logarithmic power ("dB") which are incorrect?
If you are using integer arithmetic rather than floating point arithmetic, is there any overflow occurring?