I am running an acoustic simulation. I put in a frequency and get out a complex number; the frequency response for that frequency.
I wish to generate a 1024-sample impulse response (supposing my output sample-rate is 44.1kHz)
How do I go about it?
I think I have the first step: take the Nyquist frequency 22.05kHz, and cut it into 512 equal slices. So each slice will have a bandwidth of 22050/512 Hz
Now I feed these frequencies into the simulator and get back 512 complex numbers; the first will be 0+0i corresponding to 0Hz
Now I'm following an instruction that says: 'consider 0Hz now to be the symmetry point, and add 511 negative frequencies.
So I have { Re(511) + i.Im(511), ..., Re(1) + i.Im(1), 0 + 0i, Re(1) + i.Im(1), ..., Re(511) + i.Im(511), }
1023 frequencies.
Now I'm confused. I don't know what I'm doing any more.
Apparently I need to IFFT this, and that is going to give me an 1023 sample impulse response?
Could somebody help me get my feet back on the ground?
What would the MatLab code for this look like?
(Also, is there any way to do it from the Bash shell using Python or something similar?)