Class DspFilters
digital signal processing FILTERS methods.
Assembly: AudioAnalysisTools.dll
public static class DspFilters
Fields
|
Improve this Doc
View Source
Declaration
public const double Pi = 3.1415926535897931
Field Value
Methods
|
Improve this Doc
View Source
This is ultracrude device but ................
Declaration
public static double[] AmplifyAndClip(double[] signal, double amplifificationFactor)
Parameters
Type |
Name |
Description |
Double[] |
signal |
|
Double |
amplifificationFactor |
|
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
converts passed arguments into step decay and step radians ie radians per sample or OMEGA.
Declaration
public static double[] Filter_DecayingSinusoid(double[] signal, double sf, double tHalf, double period, double filterDuration)
Parameters
Type |
Name |
Description |
Double[] |
signal |
the signal.
|
Double |
sf |
sampling frequency.
|
Double |
tHalf |
half life in seconds.
|
Double |
period |
of the cycle of interest.
|
Double |
filterDuration |
length of filter in seconds.
|
Returns
|
Improve this Doc
View Source
Declaration
public static double[] Filter_DecayingSinusoid(double[] signal, double stepDecay, double stepRadians, int filterLength)
Parameters
Returns
|
Improve this Doc
View Source
A "finite impulse response" (FIR) filter uses only the input signals,
while an "infinite impulse response" filter (IIR) uses
both the input signal and previous samples of the output signal.
FIR filters are always stable, while IIR filters may be unstable.
This filter is linear, causal and time-invariant.
Declaration
public static double[] FIR_Filter(double[] signal, double[] filterCoeff)
Parameters
Type |
Name |
Description |
Double[] |
signal |
input signal.
|
Double[] |
filterCoeff |
filter coefficients.
|
Returns
Type |
Description |
Double[] |
the filtered signal.
|
|
Improve this Doc
View Source
Declaration
public static AudioRecording GenerateTestRecording(int sampleRate, double duration, int[] harmonics, WaveType waveType)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static double[] GenerateTestSignal(int sampleRate, double duration, int[] harmonics, WaveType waveType)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static double GetGain(double[] filterCoeff)
Parameters
Type |
Name |
Description |
Double[] |
filterCoeff |
|
Returns
|
Improve this Doc
View Source
returns a digital signal having sample rate, duration and harmonic content passed by user.
Harmonics array should contain Hertz values of harmonics. i.e. int[] harmonics = { 500, 1000, 2000, 4000 };
Phase is not taken into account.
Generate Cos waves rather than Sin because amplitude should return to 1.0 if done correctly.
Declaration
public static double[] GetSignalOfAddedCosines(int sampleRate, double duration, int[] freq)
Parameters
Type |
Name |
Description |
Int32 |
sampleRate |
sr of output signal.
|
Double |
duration |
signal duration in seconds.
|
Int32[] |
freq |
an array of frequency harmonics in Hertz.
|
Returns
|
Improve this Doc
View Source
Declaration
public static double[] GetSignalOfAddedSines(int sampleRate, double duration, int[] freq)
Parameters
Returns
|
Improve this Doc
View Source
The source signal for voiced speech, that is, the vibration generated by the glottis or vocal chords,
has a spectral content with more power in low freq than in high. The spectrum has roll off of -6dB/octave.
Many speech analysis methods work better when the source signal is spectrally flattened.
The pre-emphasis filter is just a 1-order FIR filter, with gentle roll-off.
Declaration
public static double[] PreEmphasis(double[] signal, double coeff)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static double[] SubtractBaseline(double[] signal, int nh)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static void Tests()