spectral_connectivity.transforms.estimate_frequency_resolution#
- estimate_frequency_resolution(sampling_frequency: float, time_window_duration: float, time_halfbandwidth_product: float) float[source]#
Estimate the frequency resolution for given multitaper parameters.
The frequency resolution (Δf) represents the bandwidth over which spectral energy is averaged. It is determined by the time-frequency trade-off inherent in spectral analysis.
- Parameters:
sampling_frequency (float) – Sampling rate in Hz of the time series data. Note: This doesn’t affect frequency resolution, only the maximum frequency (Nyquist = sampling_frequency / 2).
time_window_duration (float) – Duration in seconds of each analysis window. Longer windows provide better (finer) frequency resolution.
time_halfbandwidth_product (float) – Time-bandwidth product controlling the spectral concentration. Higher values provide more spectral smoothing (coarser resolution).
- Returns:
frequency_resolution – Frequency resolution in Hz. This represents the bandwidth over which spectral estimates are averaged.
- Return type:
Notes
The frequency resolution formula is:
\[\Delta f = \frac{2 \cdot NW}{T}\]where: - NW is the time-halfbandwidth product - T is the time window duration in seconds
Key relationships: - Longer time windows (↑T) → Better resolution (↓Δf) - Higher time-halfbandwidth product (↑NW) → More smoothing (↑Δf)
Typical values: - For 1 Hz resolution: Use T=6s with NW=3 - For 5 Hz resolution: Use T=1.2s with NW=3 - For 0.5 Hz resolution: Use T=12s with NW=3
Examples
EEG application with 1 Hz resolution:
>>> freq_res = estimate_frequency_resolution( ... sampling_frequency=250, ... time_window_duration=6.0, ... time_halfbandwidth_product=3, ... ) >>> print(f"Frequency resolution: {freq_res} Hz") Frequency resolution: 1.0 Hz
LFP application with 5 Hz resolution:
>>> freq_res = estimate_frequency_resolution( ... sampling_frequency=1000, ... time_window_duration=1.2, ... time_halfbandwidth_product=3, ... ) >>> print(f"Frequency resolution: {freq_res} Hz") Frequency resolution: 5.0 Hz
See also
estimate_n_tapersEstimate number of tapers
suggest_parametersAutomatically suggest parameters for target resolution