IFFT Synthesis from an empty spectrum

252 views Asked by At

I'm trying to generate a sawtooth wave using the IFFT. I can do this successfully by first performing an FFT and then putting that analysed spectrum into the IFFT, however I would really like to be able to write a UI that enables me to draw the bin magnitudes and generate a spectrum from that. I have been partially successful, however the waveforms don't look quite look/sound right even though the spectrum input is per the formula for synthesising a sawtooth wave.

My question is how do I generate a spectrum array of complex values for an IFFT when all I have are the magnitude values?

I know that bin 0 and 1 are zero valued. I've been trying to render the wave by only calculating the magnitudes and phases for the significant bins containing the non zero magnitudes. Am I able to put white noise in the remaining magnitude bins and then calculate the accompanying phases at the centre frequency? Thanks in advance for your contribution.

1

There are 1 answers

4
Marcus Müller On

My question is how do I generate a spectrum array of complex values for an IFFT when all I have are the magnitude values?

sorry for the clear answer: Not at all. Your values need to be complex, so you must offer the user a method to input complex values. Letting the user specify the magnitude is only offering half of the freedom she/he needs to specify arbitrary wave forms.