Producing Waveform from Frequency Table

AI Thread Summary
To generate a sound from a frequency histogram using an 8-bit 44kHz waveform, it's essential to consider both the amplitudes and phases of the frequencies. The inverse Fourier transform algorithm can efficiently create a waveform by adding sine waves, but simply summing sine waves may lead to issues like beating, resulting in an irregular noise rather than a consistent sound. Key factors to examine include whether a 100 Hz resolution is sufficient for the desired output, ensuring the correct measurement units (amplitude vs. power), and checking for potential overflow if using integer arithmetic instead of floating point. These considerations are crucial for achieving the intended sound quality and consistency.
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
 
Technology news 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?
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top