Library / Signal processing and digital filters / DSP-50
Signal processing and digital filters
Instantaneous frequency from an analytic-signal pair
Signed average frequency over one sample interval from two successive nonzero complex analytic samples z₀ and z₁, using the principal phase increment.
- Ref
- DSP-50
- Rev
- v1
- Field
- Signal processing and digital filters
- Result
- fest [Hz]
For a tone, successive analytic samples differ by a phase of 2πf/fs. The product z₁·conj(z₀) has that phase increment as its angle, so f ≈ fs·arg(z₁ conj z₀)/(2π). The principal angle limits the result to ±fs/2, so the true phase change per sample must be below π. Small amplitudes make the angle noisy.
Signed average frequency over one sample interval from two successive nonzero complex analytic samples z₀ and z₁, using the principal phase increment. The true phase change per sample must be below π in magnitude, and near-zero amplitudes make the estimate noisy.
Calculator
- Phase increment per sample0.6283 rad
- Amplitude ratio, |z₁|/|z₀|1
- Normalised frequency, f/fs0.1 cycles/sample
What drives the result
Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.
- The phase advances 36° per sample, which at 1,000 Hz is a frequency of 100 Hz.
- The result is well inside ±500 Hz, so the principal-angle estimate is safe.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing (Hz) | Local step | Change in result |
|---|---|---|---|---|---|---|
| fs Sampling rate | 1 to 1e7 Hz | 0.1 | 1,000,000 | 1,000,000 | +10% | +10 % |
| Re z1 Real part of the second sample | −5 to 5 V | 18.62 | 481.4 | 462.8 | +0.2 V | −16 % |
| Im z1 Imaginary part of the second sample | −5 to 5 V | −224.5 | 224.5 | 448.9 | +0.2 V | +22.9 % |
| Im z0 Imaginary part of the first sample | −5 to 5 V | −118.6 | 318.6 | 437.2 | +0.2 V | −31.4 % |
| Re z0 Real part of the first sample | 0.1 to 5 V | 100 | 100 | 2.842e-14 | +10% | 0 % |
Sweep of Imaginary part of the second sample
| Imaginary part of the second sample (V) | Instantaneous frequency (Hz) |
|---|---|
| −5 | −224.5 |
| −3.75 | −216.2 |
| −2.5 | −200.2 |
| −1.25 | −158.6 |
| 0 | 0 |
| 1.25 | 158.6 |
| 2.5 | 200.2 |
| 3.75 | 216.2 |
| 5 | 224.5 |
Sweep one variable
Variables and how each one contributes
Instantaneous frequency
What the equation gives you. Everything else feeds it.
Sampling rate
The sampling rate, in Hz. Scales the frequency in direct proportion to the phase step. Raising it by 10 % (to 1,100) moves the result by +10 %, from 100 to 110 Hz.
Real part of the first sample
The real part of the first sample. Changes the first sample’s angle and amplitude, and so the phase step. Raising it by 10 % (to 1.1) moves the result by +0 %, from 100 to 100 Hz.
Imaginary part of the first sample
The imaginary part of the first sample. Changes the first sample’s angle, and so the phase step. Raising it by 10 % (to 0) moves the result by +0 %, from 100 to 100 Hz.
Real part of the second sample
The real part of the second sample. Changes the second sample’s angle, and so the phase step. Raising it by 10 % (to 0.8899) moves the result by −7.1 %, from 100 to 92.9 Hz.
Imaginary part of the second sample
The imaginary part of the second sample. Changes the second sample’s angle, and so the phase step. Raising it by 10 % (to 0.6466) moves the result by +7.31 %, from 100 to 107.3 Hz.
Worked example with the values above
- Product: z₁ conj(z₀) = 0.80902 + 0.58779i.
- Angle: arg = atan2(0.58779, 0.80902) = 0.62832 rad (36°).
- f = fs × 0.62832 / 2π = 100 Hz.
Assumptions and limits
- Integer, positive resampling factors, with a low-pass filter that gives enough alias rejection.
- For analytic-signal formulas, a narrowband signal with a clean quadrature component and less than π of phase change per sample.
Common mistakes
- Not reducing L/M by the common factor, which wastes computation.
- Forgetting the filter delay when counting output samples.
- Using the phase difference when the true change per sample exceeds π.
Statistics and uncertainty
Rates and lengths here are exact integer relations. Estimates of envelope and frequency from analytic samples are sensitive to noise, since the phase of a small sample is poorly defined, so use only samples well above the noise floor.
Where it is used
- Converting between audio and instrumentation sample rates and sizing buffers.
- Demodulating amplitude and frequency from complex baseband data.
Maths you need
- Interpolation and decimation: raising and lowering the sampling rate by integer factors
- Analytic signal: a real signal plus i times its Hilbert transform
- Principal phase: phase wrapped to the range −π to π