Class DSP_Frames
Digital signal processing methods.
Assembly: AudioAnalysisTools.dll
public static class DSP_Frames
Fields
|
Improve this Doc
View Source
Declaration
public const double Pi = 3.1415926535897931
Field Value
Methods
|
Improve this Doc
View Source
Declaration
public static double[] ConvertSamples2Milliseconds(double[] sampleCounts, int sampleRate)
Parameters
Type |
Name |
Description |
Double[] |
sampleCounts |
|
Int32 |
sampleRate |
|
Returns
|
Improve this Doc
View Source
Declaration
public static int[] ConvertZeroCrossings2Hz(double[] zeroCrossings, int frameWidth, int sampleRate)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static void DisplaySignal(double[] sig)
Parameters
Type |
Name |
Description |
Double[] |
sig |
|
|
Improve this Doc
View Source
Declaration
public static void DisplaySignal(double[] sig, bool showIndex)
Parameters
|
Improve this Doc
View Source
Calling this method sets the default FFT window, currently HANNING - see FFT.cs line 22.
Same as previous method but use frame overlap (a double) as an argument rather than framestep (an integer).
Declaration
public static DSP_Frames.EnvelopeAndFft ExtractEnvelopeAndAmplSpectrogram(double[] signal, int sampleRate, double epsilon, bool doPreemphasis, int frameSize, double overlap)
Parameters
Returns
|
Improve this Doc
View Source
Returns the following 18 values encapsulated in class EnvelopeAndFft
- the minimum and maximum signal values
- the average of absolute amplitudes for each frame
- the minimum value in each frame
- the maximum value in each frame.
- the signal envelope as vector. i.e. the maximum of absolute amplitudes for each frame.
- vector of frame energies
- the high amplitude and clipping counts
- the signal amplitude spectrogram
- the power of the FFT Window, i.e. sum of squared window values.
- the nyquist
- the width of freq bin in Hz
- the Nyquist bin ID
AND OTHERS
The returned info is used by Sonogram classes to draw sonograms and by Spectral Indices classes to calculate Spectral indices.
Less than half the info is used to draw sonograms but it is difficult to disentangle calculation of all the info without
reverting back to the old days when we used two classes and making sure they remain in synch.
Declaration
public static DSP_Frames.EnvelopeAndFft ExtractEnvelopeAndAmplSpectrogram(double[] signal, int sampleRate, double epsilon, bool doPreemphasis, int frameSize, int frameStep, string windowName = null)
Parameters
Returns
|
Improve this Doc
View Source
Calling this method will set default FFT window if windowName is null.
Otherwise sets the FFT window specified in the config file.
Declaration
public static DSP_Frames.EnvelopeAndFft ExtractEnvelopeAndFfts(AudioRecording recording, bool doPreemphasis, int frameSize, double overlap, string windowName = null)
Parameters
Returns
|
Improve this Doc
View Source
Calling this method sets the default FFT window, currently HANNING - see FFT.cs line 22.
Declaration
public static DSP_Frames.EnvelopeAndFft ExtractEnvelopeAndFfts(AudioRecording recording, bool doPreemphasis, int frameSize, int frameStep)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static Tuple<double[], double[], double[], double[], double[]> ExtractEnvelopeAndZeroCrossings(double[] signal, int sr, int windowSize, double overlap)
Parameters
Returns
|
Improve this Doc
View Source
Returns the signal broken into frames.
This method is not called because the only reason to break a signal into frames is to do fft on the frames.
Declaration
public static double[, ] Frames(double[] data, int[, ] startEnds)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static int[, ] FrameStartEnds(int dataLength, int frameSize, double windowOverlap)
Parameters
Returns
Type |
Description |
Int32[,] |
|
|
Improve this Doc
View Source
Returns the start and end index of all frames in a long audio signal.
Declaration
public static int[, ] FrameStartEnds(int dataLength, int frameSize, int frameStep)
Parameters
Returns
Type |
Description |
Int32[,] |
|
|
Improve this Doc
View Source
Declaration
public static int FrameStep(int windowSize, double windowOverlap)
Parameters
Type |
Name |
Description |
Int32 |
windowSize |
|
Double |
windowOverlap |
|
Returns
|
Improve this Doc
View Source
returns the min and max values in each frame. Signal values range from -1 to +1.
Declaration
public static void SignalEnvelope(double[, ] frames, out double[] minAmp, out double[] maxAmp)
Parameters
|
Improve this Doc
View Source
counts the zero crossings in each frame
This info is used for determining the begin and end points for vocalizations.
Declaration
public static int[] ZeroCrossings(double[, ] frames)
Parameters
Type |
Name |
Description |
Double[,] |
frames |
|
Returns