Frequency response at the ear drum
Apr 28, 2024 at 6:16 AM Post #271 of 285
The idea is that you can fully reconstruct the CSD from the FR, in a linear time-invariant system. And with minimum-phase systems (which by definition are linear time-invariant), you can reconstruct the CSD from magnitude response alone, without the need to know phase information at all. Both of these are just well established mathematical results. Indeed, at times it could be helpful to reconstruct the CSD from FR, so that time-domain information is more clearly presented to the reader. But that doesn't mean the information is not already contained in the FR.

Strictly speaking, IEMs aren't minimum-phase or even linear time-invariant. It is indeed an assumption. But that assumption is justified and reasonable, because the deviation of most IEMs from a minimum-phase system is very small and probably negligible.
Right, the assumption is where I have a problem. I don't want assumptions made when the assumption is not necessary given the data being assumed is already collected in order to generate the FR in the first place. An assessment on quality also involves examining the phase alignment and resonance characteristics of the transducer, thus necessitating accurate time information as opposed to assumed time information.
 
Apr 28, 2024 at 7:52 AM Post #272 of 285
IR by definition contains three dimensions of information (frequency, amplitude, time), thus has all the information required to derive other metrics that rely on some or all of these dimensions. Running the IR through a FFT to get the FR requires no assumptions because all facts are in evidence and the amount of information being presented is being reduced, thus making the conclusion valid and sound.
I’m still having trouble understanding your difficulty but maybe the above quote is the issue? The IR by definition only contains two (not three) dimensions of information, amplitude and time. Of course, it depends on what you mean by “contains” as the frequency can be derived from the amplitude and time (with a FFT), and the process is reversible, the amplitude and time can be derived from the frequency using an inverse FFT.

G
 
Apr 28, 2024 at 8:32 AM Post #273 of 285
I’m still having trouble understanding your difficulty but maybe the above quote is the issue? The IR by definition only contains two (not three) dimensions of information, amplitude and time. Of course, it depends on what you mean by “contains” as the frequency can be derived from the amplitude and time (with a FFT), and the process is reversible, the amplitude and time can be derived from the frequency using an inverse FFT.

G
Right, as frequency is a function of amplitude cycles over time, the derivation of frequency requires no assumptions to conduct the Fourier transform for the purpose of easily analyzing the frequency content of the complex signal captured in the Dirac delta IR.

The issue now is that converting from FR to IR requires converting the imaginary time domain represented in the FR to the real time domain in the IR, which requires assumptions on when the recorded amplitudes occured in the original IR used to obtain the FR. All the information on amplitude over time is technically preserved in the FR, but there is no way to derive the real time domain component back out of the imaginary time domain without assuming it's position in the phase.

If the system is LTI and minimum phase, you can convert back and forth with no issue because the assumption of phase position is correct, so theoretically you have no loss of information. As the system deviates from perfect phase alignment, the phase error incurred by converting the FR to IR via IFT becomes larger because of this.
 
Apr 28, 2024 at 12:04 PM Post #274 of 285
Last edited:
Apr 28, 2024 at 4:20 PM Post #276 of 285
Not sure if it helps, but I did that, in practice :), with a piece of music:
https://www.audiosciencereview.com/...ything-or-nothing.29062/page-258#post-1426610
By frequency response @KinGensai means only the magnitude part of the frequency response specifically, even if he doesn't realize it yet. If you extracted the magnitude of the spectrum and applied the IFFT only to that, you would not have gotten a null. When calculating the IFFT of music you wouldn't be able to discard the phase of the spectrum because there's no relationship between the magnitude and the phase of the spectrum. When calculating the IFFT of the frequency response function from a minimum phase LTI system, while the phase response is still needed to correctly get the impulse response, the phase can just be calculated from the frequency response itself as they are linked together in that case. The impulse response can always describe an LTI system while the magnitude part of the frequency response function can only describe an LTI system when we know of additional rules that apply to the system (such as being minimum phase, or knowing it doesn't have any phase shift at all...)

@KinGensai
About the FFT and IFFT you could just think of them as some generic mathematical operation. Ultimately all that The FFT does is mapping a sequence of numbers to an other sequence of numbers. The IFFT can take the mapped numbers and map it back to the original sequence. As an example, the relationship between the FFT and IFFT is the same as the relationship between multiplication and division or exponentials and logarithms in this regard. You could take some exponent of a sequence of numbers, apply the appropriate logarithm to it and get back the original sequence of numbers. I think the best way to understand this would be to forget the "fast" part of FFT and do a pen and paper calculation of a DFT and IDFT by just simply substituting in some random numbers into the equations.
 
Apr 28, 2024 at 5:08 PM Post #277 of 285
Right, the assumption is where I have a problem. I don't want assumptions made when the assumption is not necessary given the data being assumed is already collected in order to generate the FR in the first place. An assessment on quality also involves examining the phase alignment and resonance characteristics of the transducer, thus necessitating accurate time information as opposed to assumed time information.
The point is that the assumption is generally harmless. IEMs usually deviate from minimum-phase systems only very slightly, in negligible amounts, the audibility of the deviations are severely in doubt.
 
Apr 28, 2024 at 5:15 PM Post #278 of 285
Right, as frequency is a function of amplitude cycles over time, the derivation of frequency requires no assumptions to conduct the Fourier transform for the purpose of easily analyzing the frequency content of the complex signal captured in the Dirac delta IR.

The issue now is that converting from FR to IR requires converting the imaginary time domain represented in the FR to the real time domain in the IR, which requires assumptions on when the recorded amplitudes occured in the original IR used to obtain the FR. All the information on amplitude over time is technically preserved in the FR, but there is no way to derive the real time domain component back out of the imaginary time domain without assuming it's position in the phase.

If the system is LTI and minimum phase, you can convert back and forth with no issue because the assumption of phase position is correct, so theoretically you have no loss of information. As the system deviates from perfect phase alignment, the phase error incurred by converting the FR to IR via IFT becomes larger because of this.
Just be reminded that magnitude response (the amplitude of each of the frequencies) is sufficient to calculate the phase response of each frequency, given that the system is minimum-phase, via the Hilbert Transform. So you really don't need to measure separately phase information in such systems.

On the other hand, if what you have really is frequency response in the technical sense, then that frequency response contains phase information explicitly. That is the result of Fourier Transform, which specifies three things for each component: the frequency, the amplitude, and the phase angle. The time-domain is explicitly there.

The phase angle is omitted in the presentation of FR data (so it becomes a magnitude response in the technical sense) for IEMs exactly because they are basically minimum-phase, and so if you know the frequency and the amplitude then you can calculate the phase via Hilbert Transform; there can be no change in phase response in minimum-phase systems without a corresponding change in the magnitude response.
 
Apr 28, 2024 at 7:24 PM Post #279 of 285
I think I get where I was mixed up, a FR consists of complex numbers plotting out each sample's magnitude and phase information. The magnitude is "real" and the phase is "imaginary" in the display of the FR, so IFT takes the fourier coefficients to reconstruct each sinusoid and combine them back into the original signal.

Seeing @danadam post the example really helped put the equations into context, I'm not all that great at math so that and a visual representation of the FT and IFT is helping.
 
Apr 29, 2024 at 6:35 PM Post #280 of 285
If we agree that IEMs (and OE headphones) are minimum-phase and therefore the FR contains all of the IR information, then it seems to me that FR contains all of the information that describes how an IEM can sound. And if that is true then it follows that two IEMs with the same FR at the ear drum would sound exactly the same in all respects, no matter how that FR is achieved. 😬

Of course there would still an exception if the volume level is high enough to cause one of the two to audibly distort. This is the same as them having different FR at that level.
 
May 2, 2024 at 1:43 AM Post #281 of 285
I have a follow up question on FTs. How does the heisenburg uncertainty theorem apply to FTs?

The way I'm understanding this, a Dirac IR used to derive FR would be less accurate to the transducer's behavior over time compared to a sine sweep, which is why I assume sine sweeps are the standard practice. So what about complex signals like music? Isn't there some level of information on system behavior lost no matter what the size of the time sample used for the FFT is? The scale of lost information is probably miniscule, but there is some info lost because the FT produces averaged responses as dictated by the equation and the uncertainty theorem, right?
 
May 2, 2024 at 5:27 AM Post #282 of 285
I have a follow up question on FTs. How does the heisenburg uncertainty theorem apply to FTs?

The way I'm understanding this, a Dirac IR used to derive FR would be less accurate to the transducer's behavior over time compared to a sine sweep, which is why I assume sine sweeps are the standard practice. So what about complex signals like music? Isn't there some level of information on system behavior lost no matter what the size of the time sample used for the FFT is? The scale of lost information is probably miniscule, but there is some info lost because the FT produces averaged responses as dictated by the equation and the uncertainty theorem, right?
How uncertainty principle applies to fourier transforms:


By far the best videos I've found on fourier transform and series:



There's a very intuitive explanation on the fourier uncertainty principle somewhere from the same person but I can't find it. Have you ever watched two cars using their turn signals at the same time at a red light? Something you would notice is that the flashing get in and out of sync over time. This is because they don't perfectly pulse at the same frequency. Imagine if one car's turn signal flashes 1 times a second but the other one flashes at 1.01 times a second. In that case, after 50 seconds they completely fall out of sync while after 100 seconds they are back to flashing perfectly together again. If you only looked at the cars for the first couple of flashes you would think that their frequency is the same, you wouldn't look at them for long enough to see that they eventually get out of sync. If you spent enough time to observe them, you would eventually notice that they start to fall out of sync and are completely out of sync in 50 seconds. If the difference between them was only 0.001Hz instead of 0.01Hz you wouldn't notice the difference even you observed for 50 seconds. The "more time" you spend at looking the turn signals, the "more sure" you can be their frequencies are actually the same, not just similar.

I think this gives a good intuitive understanding of why you have to observe over a longer period of time if you want to have an accurate reading on frequencies but of course if you want definitive proof you can't avoid understanding the math.
 
May 2, 2024 at 10:31 AM Post #283 of 285
How uncertainty principle applies to fourier transforms:


By far the best videos I've found on fourier transform and series:



There's a very intuitive explanation on the fourier uncertainty principle somewhere from the same person but I can't find it. Have you ever watched two cars using their turn signals at the same time at a red light? Something you would notice is that the flashing get in and out of sync over time. This is because they don't perfectly pulse at the same frequency. Imagine if one car's turn signal flashes 1 times a second but the other one flashes at 1.01 times a second. In that case, after 50 seconds they completely fall out of sync while after 100 seconds they are back to flashing perfectly together again. If you only looked at the cars for the first couple of flashes you would think that their frequency is the same, you wouldn't look at them for long enough to see that they eventually get out of sync. If you spent enough time to observe them, you would eventually notice that they start to fall out of sync and are completely out of sync in 50 seconds. If the difference between them was only 0.001Hz instead of 0.01Hz you wouldn't notice the difference even you observed for 50 seconds. The "more time" you spend at looking the turn signals, the "more sure" you can be their frequencies are actually the same, not just similar.

I think this gives a good intuitive understanding of why you have to observe over a longer period of time if you want to have an accurate reading on frequencies but of course if you want definitive proof you can't avoid understanding the math.

I get it, I'm just thinking of how error is introduced into the FT as the length of time changes, as in doing an FFT on 1024 samples vs 2048 on a signal that isn't necessarily static.

I guess it's not really practically relevant for audio because 2048 samples is approx 1/25th of a second for a 44.1k sampling rate so we aren't going to notice such a miniscule discrepancy.
 
May 14, 2024 at 1:44 PM Post #284 of 285
I guess it's not really practically relevant for audio because 2048 samples is approx 1/25th of a second for a 44.1k sampling rate so we aren't going to notice such a miniscule discrepancy.
There isn't any error or discrepancy for the discrete fourier transform (DFT). The DFT can be applied to the audio signal by 64 samples at a time or by 2048 samples at a time or by 100000 samples at a time, it doesn't matter. The inverse transform will give the audio samples back perfectly as long as the window size of the inverse transform is the same. However, there can be a discrepancy if one incorrectly assumes that the samples are periodic. By definition, the DFT shows the spectrum of a discrete periodic signal with a period time of the chosen window size (number of samples transformed). Audio is virtually never periodic. On top of that, there still can be an error even if the analyzed signal is periodic.

Consider the following example:
dft.png
The DFT is applied to a 600Hz sampled cosine wave. 48000 samples are taken every second. If we take 200 samples and calculate the DFT of that, we've effectively sampled 2 and a half periods of the cosine wave. The DFT shows the spectrum of a signal with the period time of its window size (200 samples) so once we apply the IDFT to that spectrum and add in the rest of the periods, we end up with an incorrect signal because the actual analyzed signal is periodic by 80 samples (and its integer multiples as well). As can be seen, this error shows up as "discontinuities" in the time domain.

The discontinuity is particularly bad in this case because the sampling is off by exactly half cycle of the cosine wave. This discontinuity shows as spectral leakage in the frequency domain. The spectral leakage is the direct consequence of the discontinuity so essentially the spectrum just correctly shows the quick and abrupt change of the assumed signal even though there were no such "jumps" in the originally sampled signal.

If we don't make this assumption of periodicity, we could instead take the DFT from the following 200 samples (instead of assuming they are the same 200 samples as before), apply the IDFT to that, this way we would get back the correct waveform up to the first 400 samples with no discontinuity at all.

In a more broad view, the reason we have to assume something about the signal outside of the analyzed part is because if the signal isn't completely defined in the time domain, it can't be defined in the frequency domain either. The fourier transform in its most general form is an integral over negative infinity to infinity which I'm sure you've seen plenty of times by now. Whenever the fourier transform is restricted to a time period between t1 and t2, there's an implicit assumption of the function outside of the time interval between t1 and t2. By far the most used assumption is that the function has the same period time as the analyzed interval because that is what most often gives useful results. Less often, the function is assumed to be zero instead but nonetheless, the fourier transform doesn't exist for functions that aren't defined for all the real numbers.
 
Last edited:
May 14, 2024 at 4:00 PM Post #285 of 285
There isn't any error or discrepancy for the discrete fourier transform (DFT). The DFT can be applied to the audio signal by 64 samples at a time or by 2048 samples at a time or by 100000 samples at a time, it doesn't matter. The inverse transform will give the audio samples back perfectly as long as the window size of the inverse transform is the same. However, there can be a discrepancy if one incorrectly assumes that the samples are periodic. By definition, the DFT shows the spectrum of a discrete periodic signal with a period time of the chosen window size (number of samples transformed). Audio is virtually never periodic. On top of that, there still can be an error even if the analyzed signal is periodic.

Consider the following example:
dft.png
The DFT is applied to a 600Hz sampled cosine wave. 48000 samples are taken every second. If we take 200 samples and calculate the DFT of that, we've effectively sampled 2 and a half periods of the cosine wave. The DFT shows the spectrum of a signal with the period time of its window size (200 samples) so once we apply the IDFT to that spectrum and add in the rest of the periods, we end up with an incorrect signal because the actual analyzed signal is periodic by 80 samples (and its integer multiples as well). As can be seen, this error shows up as "discontinuities" in the time domain.

The discontinuity is particularly bad in this case because the sampling is off by exactly half cycle of the cosine wave. This discontinuity shows as spectral leakage in the frequency domain. The spectral leakage is the direct consequence of the discontinuity so essentially the spectrum just correctly shows the quick and abrupt change of the assumed signal even though there were no such "jumps" in the originally sampled signal.

If we don't make this assumption of periodicity, we could instead take the DFT from the following 200 samples (instead of assuming they are the same 200 samples as before), apply the IDFT to that, this way we would get back the correct waveform up to the first 400 samples with no discontinuity at all.

In a more broad view, the reason we have to assume something about the signal outside of the analyzed part is because if the signal isn't completely defined in the time domain, it can't be defined in the frequency domain either. The fourier transform in its most general form is an integral over negative infinity to infinity which I'm sure you've seen plenty of times by now. Whenever the fourier transform is restricted to a time period between t1 and t2, there's an implicit assumption of the function outside of the time interval between t1 and t2. By far the most used assumption is that the function has the same period time as the analyzed interval because that is what most often gives useful results. Less often, the function is assumed to be zero instead but nonetheless, the fourier transform doesn't exist for functions that aren't defined for all the real numbers.

Thanks for taking the time for the detailed explanation!

On a side note, Spectral Leakage would be a fantastic name for a death metal band.
 

Users who are viewing this thread

Back
Top