I am still learning, so please bear with me:
My audio measurement tool exports the measured spectrum of the DUT in the following format:
- Frequency [Hz]
- Magnitude [dB]
- Phase [degree]
It is stored in a simple text file.
I managed already to read the file in Matlab, split the lines into vectors for each column. So I have now a vector for the frequency points, a vector for the magnitude values and a vector for the phases.
Now I want to generate the impulse response from it. I managed already to interpolate the values on a FFT frequency grid e.g. for a 4096-points FFT and that the second half (the negative frequencies) can be obtained with conj(X) and mirrored. That's all clear. So I can run ifft on it. What is not clear to me is, how to handle the phases.
Can I just write:
X = 10.^(mag/20) .* exp(j*phi/360*2*pi)
with
mag
the vector with imported magnitude values in dB andphi
the vector with imported phase values in degree?
Or do I need to apply another conversion to phi? Something that takes the sampling frequency into account?