pyfar icon indicating copy to clipboard operation
pyfar copied to clipboard

Roadmap to complex signals

Open f-brinkmann opened this issue 3 years ago • 0 comments

Problem: We want to allow signals with complex time data

Required changes in audio classes:

  • [x] TimeData: add complex argument in init and make it a class property
  • [x] Signal.domain: check complex and chose FFT accordingly
  • [x] Signal.freq: Call normalization according to complex property
  • [x] FFT module: wrap fft and ifft and fft_frequencies in analogy to the real parts
  • [x] Frequencies in complex signals will go from -fs/2 to fs/2
  • [x] check arithmetic operations on audio class, with one complex and one real-valued signal.

Changes in plot module (good first issues)

  • [x] Plot functions time domain: add parameter ??? to plot 'real', 'imag', or 'abs' values
  • [x] Plot functions frequency domain: add parameter side to plot 'left' or 'right' sided spectrum
  • [ ] Add plot interaction for both parameters

Add tests in dsp module (good first issues)

  • [x] average
  • [x] convolve
  • [x] decibel
  • [x] deconvolve
  • [x] fractional_time_shift
  • [x] phase
  • [x] pad_zeros
  • [x] regularized_spectrum_inversion
  • [x] resample (depends on scipy implementation)
  • [x] spectrogram
  • [x] time_shift
  • [x] time_window
  • [x] filter classes

Throw errors in dsp module - we decided to implement energy, power, and rms for complex signals

  • [x] energy
  • [x] power
  • [x] rms

Possibily change functionality

  • [x] find_impulse_response_delay:
  • [x] find_impulse_response_start: detect separately for real and imag and return earliest or use absolute value (test with gammatone filters and decide later, probably absolute value because this is the envelope)
  • [x] group_delay (check because the estimation is FFT based)
  • [x] normalize (some modes like rms not supported)
  • [ ] smooth_fractional_octaves
  • [x] update concatenate function (see comment in #452)

Open question (throw errors for now)

  • [ ] linear_phase
  • [ ] minimum_phase
  • [ ] zero_phase

To discuss:

  • arithmetic operation that casts a real to complex valued signal, with invalid ftt_norm. Cast to none or error?

To do:

  • check docstrings for all above methods

f-brinkmann avatar Nov 10 '22 14:11 f-brinkmann