AnalyzeTools.WidgetFft package¶
Submodules¶
AnalyzeTools.WidgetFft.CalculationFft module¶
-
class
AnalyzeTools.WidgetFft.CalculationFft.
CalculationFft
(snare, buffer, calib, nthOctave, timeWeight, fqWeight)¶ Bases:
AnalyzeTools.Calculation.Calculation
FFT Calculation Class including the methods for the FFT signal processing.
variables self.values: Buffer values. self.xAxis: To write the xAxis values into.
Additional variables self.nthOctave int: 1, 3, 6, 12, 24 self.xAxisComplete
-
calcBars
(a, bandNo, bandFinal, FqAxisExact, nthOctave)¶ Calculates the FFT bars.
note:: Exception for the upper frequency in full octave calculation is realized, which allowes to attain a value above Fs/2. Otherwise the highest bar in full ocatve would be 16kHz instead of 20kHz because of a few percentage of missing values.
Parameters: - a (array) – values
- bandNo (int) – start noninal band number
- bandFinal (int) – final nominal band number
- FqAxisExact (array) – exact frequency axis which correpsonds to param a (in contrast to the rounded nominal axis)
- nthOctave (int) – N FFT octave
Returns: Array with calculated bars
Return type: array
-
calculate
()¶ Calculates the single sided FFT. A fftSize of 2^18 is choosen which offers a resolution of 32 values in the lowest frequency bin. When calculating the dB values of the energetic values the return is either dBFS or dBSPL depending on calibration. Stores the result in self.values, self.xAxis and self.xAxisComplete.
-
centerFqExact
(bandNo, nthOctave)¶ Returns the exact center frequency of given band no and N.
Parameters: - bandNo (int) – Band number of needed center frequency.
- nthOctave (int) – N FFT octave
Returns: exact center frequency in Hz
Return type: float
-
edgeFqExact
(centerFq, nthOctave)¶ Returns the exact edge frequencies for a given center frequency and N.
Parameters: - centerFq (float) – center frequency
- nthOctave (int) – N FFT octave
Returns: exact side frequencies in Hz
Return type: tuple
-
fftBandNo
()¶ Returns the correct nominal start and end band no as well as well as the stepsize corresponding to the current Nth Octave.
Returns: Nominal start and finish band and stepsize Return type: tuple
-
AnalyzeTools.WidgetFft.PlotFft module¶
-
class
AnalyzeTools.WidgetFft.PlotFft.
PlotFft
(calcObj, calib)¶ Bases:
AnalyzeTools.Plot.Plot
QWidget class which contains the FFT figure plot.
General acessable variables (from calculation instance): self.values – calculation result self.xAxis – calculated x Axis
Additional variables: self.nthOctave – 3, 6, 12, 24th Octave self.xAxisComplete – complete frequency axis with all nominal values. Depending on nth Octave the right values are picked.
-
getPlot
()¶ Returns the plot obj with plotted matplot canvas (self.canvas).
Returns: plot object Return type: Obj
-
AnalyzeTools.WidgetFft.WidgetFft module¶
-
class
AnalyzeTools.WidgetFft.WidgetFft.
WidgetFft
(snare, channel, selNo, timeWeight, fqWeight, parm1, parm2, parm3)¶ Bases:
AnalyzeTools.AnalyzeWidget.AnalyzeWidget
Fast Fourier Transform Analyze Widget.
Plots the one sided nth Octave FFT with N = 1, 3, 6, 12, 24. The values are frequency- and time-weighted depending on the user selection. According to whether calibration is set, the values are either in dB fullscale peakvalues or in dB soundpressure level values. seealso::For further information on the calculation implementation have a look at CalculationFft.
note::At initialisation the calculation and plotFigure methods are executed automatically.
note:: The essential parts which will be automatically set to the widget (by base class): self.figurePlot – actual matplot figure self.nav – navigation menu (dropdown selections, zoom, pan etc) self.titleLabel – widget title self.infoLabel – additonal widget information
-
calculate
()¶ Initialize the calculation object and execute it.
-
plot
()¶ Initialize the plot object, store the matplot figure and fill out the labels.
-