0

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.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
cixelsyd
  • 31
  • 2

1 Answers1

1

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.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
  • I understand the numbers need to be complex. I'm not trying to IFFT a spectrum of just magnitudes. I am calculating phases for the magnitudes > 0. If what you saying is true, how would a synthesiser like the K5000 exist? It provides a user interface where the user can modify magnitudes without having to edit phases? – cixelsyd Jun 25 '15 at 19:35
  • 1
    I don't know a device called K5000, but we both agree that magnitude information isn't enough to reproduce a specific waveform using an IFFT. So your approach is lacking half of the information. Maybe that K5000 is not doing an IDFT, but something like an IDCT? – Marcus Müller Jun 25 '15 at 19:39
  • Thanks for the response Marcus. If I'm calculating the phases for magnitudes of > 0 based on the note frequency, how might i approach calculating the bins in between these? are these random numbers? The appear to be from my FFT analysis efforts. – cixelsyd Jun 25 '15 at 19:55
  • 1
    I don't know on what basis you are calculating phases, or what your objective is, to be honest. For me, an DFT is a mapping between an N-dimensional vector space over the complex numbers into another N-dimensional vector space over the complex numbers. If you only give real numbers and don't restrict the set of results you want to have, I don't see how there's "right" phases. – Marcus Müller Jun 25 '15 at 21:47