dhbw.dasp.plot module
Collection of plot functions. Each function returns an instance of this module.
- class dhbw.dasp.plot.fft[source]
Bases:
object
- class dhbw.dasp.plot.filter[source]
Bases:
object- frequency(a, xlim=None, ylim=None, **kwargs)[source]
Plot frequency response of the transfer function specified by b and a coefficients.
- Parameters:
- barray
The numerator coefficient array.
- aarray
The denominator coefficient array.
- xlimfloat, tuple, optional
Frequency limits in Hz.
- ylimfloat, tuple, optional
Amplitude value limits in dB.
- impulse(a, clip=1000.0, xlim=None, ylim=None, **kwargs)[source]
Plot impulse response of the transfer function specified by b and a coefficients.
- Parameters:
- barray
The numerator coefficient array.
- aarray
The denominator coefficient array.
- clipfloat, optional
Clip response amplitudes outside the specified interval.
- xlimfloat, tuple, optional
Time limits.
- ylimfloat, tuple, optional
Amplitude limits.
- phase(a, xlim=None, ylim=None, **kwargs)[source]
Plot phase response of the transfer function specified by b and a coefficients.
- Parameters:
- barray
The numerator coefficient array.
- aarray
The denominator coefficient array.
- xlimfloat, tuple, optional
Frequency limits in Hz.
- ylimfloat, tuple, optional
Phase value limits in rad.
- dhbw.dasp.plot.phasogram(x, y, s, t, xlim=None, ylim=None, clim=None, cmap='twilight', **kwargs)[source]
Plot STFT phase of the audio signal.
- Parameters:
- xarray
Timeline array.
- yarray
Signal amplitude array.
- sfloat
STFT step size in seconds.
- tfloat
STFT time span in seconds.
- xlimfloat, tuple, optional
Time limits.
- ylimfloat, tuple, optional
STFT frequency limits in Hz.
- climfloat, tuple, optional
STFT phase value limits in dB.
- cmapstr, optional
Plot color map.
- dhbw.dasp.plot.save(path, size=None, dpi=None)[source]
Save current figure to specified image file.
- Parameters:
- pathstr
Output image file path.
- sizetuple, optional
Output image size (w, h) in inches.
- dpiint, optional
Output image resolution in dots per inch.
- dhbw.dasp.plot.signal(x, y=None, xlim=None, ylim=1.1)[source]
Plot one or multiple audio signals.
- Parameters:
- xarray or same as y
Timeline array if y is not None.
- yarray, tuple or list of arrays, optional
Audio signal(s) to plot, e.g. mono (y) or stereo (y0, y1).
- xlimfloat, tuple, optional
Time limits.
- ylimfloat, tuple, optional
Amplitude limits.
- dhbw.dasp.plot.spectrogram(x, y, s, t, xlim=None, ylim=None, clim=-120, cmap='inferno', **kwargs)[source]
Plot STFT amplitude of the audio signal.
- Parameters:
- xarray
Timeline array.
- yarray
Signal amplitude array.
- sfloat
STFT step size in seconds.
- tfloat
STFT time span in seconds.
- xlimfloat, tuple, optional
Time limits.
- ylimfloat, tuple, optional
STFT frequency limits in Hz.
- climfloat, tuple, optional
STFT amplitude limits in dB.
- cmapstr, optional
Plot color map.