Analysis classes (analysis)

Classes to analyse physical data

Modules

acousticPressureScales.py

Module with methods to process 1D data sample with extension especially for acoustic applications.

class AcousticPressureScales(pressure_time, d_time, pressure_reference=2e-05)[source]

Class to process 1D data sample with extension especially for acoustic applications.

get_autocorrelation()[source]

calculate the auto correlation of a signal

get_psd()[source]

Convert the pressure amplitudes to PSD based unit

get_spl(filter_name=None)[source]

Convert the pressure amplitudes to SPL based unit

set_windowing_params(window_type, window_size, window_overlap)[source]

set or change the parameter for the FFT

sampleStats.py

Module with methods to process 1D data sample with some statistical methods.

class SampleStats(time, value, variable_name, windowSize=0, windowType='FLAT', windowOverlap=0)[source]

Class to analyse data with some statistical methods

analyse()[source]

Perform all analysis

plot_results()[source]

Plot the results in a time strand, spectrum and histogram

print_dominatingFrequencies(ntop=5)[source]

Print frequencies with highest amplitudes

print_stats()[source]

Print the results of the stats analysis

windowedFFT - Perform a fast fourier transformation

Created on 11.01.2013

author: well_jn

Perform a fast fourier transformation of a real function. You have the choice of multiple __window functions. For no windowing use the default values of the constructor. Choices of __window functions: HAMMING, HANNING, BARTLETT, BLACKMAN, FLAT

Example:

from analysis.windowedFFT import WindowedFFT

time = np.arange(0, 1, dt)
myFFT = WindowedFFT(func_timeDomain = np.sin(2 * np.pi * freq * time), d_time = dt, window_type = 'HAMMING', window_size = 50)
freq = myFFT.getFrequencies()
func_freq = myFFT.getSpectrum()

Create a time array and with this a sine function. Create windowedFFT object with this sine and the choice for the windowing. You get the frequencies for the positive range of the FFT and the single single-sided amplitude spectrum of the sine.

requires

numpy

class WindowedFFT(func_timeDomain, d_time, window_type='FLAT', window_size=0, window_overlap=0)[source]

Class to setup a FFT with windowing to get the single-sided amplitude spectrum of a real function

getSingleSidedFrequencies()[source]

Get corresponding frequencies for the resulting spectrum.

getSingleSidedSpectrum()[source]

Compute a single-sided amplitude spectrum of a real __func_timeDomain(t) with windowing.

setWindowOverlap(window_overlap: int)[source]

Set the overlapping of the window.

setWindowSize(window_size: int)[source]

Set the length of the used window.

setWindowType(window_type)[source]

Set which type of windowing you want to use. Possible choices are: - HAMMING - HANNING - BARTLETT - BLACKMAN - FLAT