Class FrequencyScale
Inherited Members
Namespace: AudioAnalysisTools.DSP
Assembly: AudioAnalysisTools.dll
Syntax
public class FrequencyScale
Constructors
| Improve this Doc View SourceFrequencyScale(FreqScaleType)
Initializes a new instance of the Frequency
Declaration
public FrequencyScale(FreqScaleType fst)
Parameters
| Type | Name | Description |
|---|---|---|
| Freq |
fst |
FrequencyScale(FreqScaleType, Int32, Int32, Int32, Int32)
Initializes a new instance of the Frequency
Declaration
public FrequencyScale(FreqScaleType type, int nyquist, int frameSize, int finalBinCount, int hertzGridInterval)
Parameters
| Type | Name | Description |
|---|---|---|
| Freq |
type | |
| Int32 | nyquist | |
| Int32 | frameSize | |
| Int32 | finalBinCount | |
| Int32 | hertzGridInterval |
FrequencyScale(FreqScaleType, Int32, Int32, Int32, Int32, Int32)
Initializes a new instance of the Frequency
Declaration
public FrequencyScale(FreqScaleType type, int nyquist, int frameSize, int linearBound, int octaveToneCount, int hertzGridInterval)
Parameters
| Type | Name | Description |
|---|---|---|
| Freq |
type | Scale type must be an OCTAVE type. |
| Int32 | nyquist | sr / 2. |
| Int32 | frameSize | Assumes that frame size is power of 2. |
| Int32 | linearBound | The bound (Hz value) that divides lower linear and upper octave parts of the frequency scale. |
| Int32 | octaveToneCount | Number of fractional Hz steps within one octave. This is ignored in case of custom scale. |
| Int32 | hertzGridInterval | Only used where appropriate to draw frequency gridlines. |
FrequencyScale(Int32, Int32, Int32)
Initializes a new instance of the Frequency
Declaration
public FrequencyScale(int nyquist, int frameSize, int hertzGridInterval)
Parameters
| Improve this Doc View SourceFrequencyScale(Int32, Int32, Int32, Int32)
Initializes a new instance of the Frequency
Declaration
public FrequencyScale(int nyquist, int frameSize, int finalBinCount, int hertzGridInterval)
Parameters
Properties
| Improve this Doc View SourceBinBounds
Gets or sets the bin bounds of the frequency bands for octave scale bin id in first column and the Hz value in second column of matrix.
Declaration
public int[, ] BinBounds { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32[,] |
FinalBinCount
Gets or sets number of frequency bins in the final spectrogram.
Declaration
public int FinalBinCount { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
GridLineLocations
Gets or sets the location of gridlines (first column) and the Hz value for the grid lines (second column of matrix).
Declaration
public int[, ] GridLineLocations { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32[,] |
HertzGridInterval
Gets or sets herz interval between gridlines when using a linear or mel scale.
Declaration
public int HertzGridInterval { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
LinearBound
Gets or sets top end of the linear part of an Octave Scale spectrogram.
Declaration
public int LinearBound { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Nyquist
Gets or sets half the sample rate.
Declaration
public int Nyquist { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
ScaleType
Gets or sets the scale type i.e. linear, octave etc.
Declaration
public FreqScaleType ScaleType { get; set; }
Property Value
| Type | Description |
|---|---|
| Freq |
ToneCount
Gets or sets number of bands or tones per octave.
Declaration
public int ToneCount { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
WindowSize
Gets or sets frame size for the FFT.
Declaration
public int WindowSize { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
WindowStep
Gets or sets step size for the FFT window.
Declaration
public int WindowStep { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Methods
| Improve this Doc View SourceDrawFrequencyLinesOnImage(Image<Rgb24>, FrequencyScale, Boolean)
Declaration
public static void DrawFrequencyLinesOnImage(Image<Rgb24> bmp, FrequencyScale freqScale, bool includeLabels)
Parameters
| Type | Name | Description |
|---|---|---|
| Six |
bmp | |
| Frequency |
freqScale | |
| Boolean | includeLabels |
DrawFrequencyLinesOnImage(Image<Rgb24>, Int32[,], Boolean)
Declaration
public static void DrawFrequencyLinesOnImage(Image<Rgb24> bmp, int[, ] gridLineLocations, bool includeLabels)
Parameters
| Type | Name | Description |
|---|---|---|
| Six |
bmp | |
| Int32[,] | gridLineLocations | |
| Boolean | includeLabels |
GetBinIdForHerzValue(Int32)
returns the binId for freq bin closest to the passed Hertz value.
Declaration
public int GetBinIdForHerzValue(int hertzValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | hertzValue |
Returns
| Type | Description |
|---|---|
| Int32 |
GetBinIdInReducedSpectrogramForHerzValue(Int32)
returns the binId for the grid line closest to the passed frequency.
Declaration
public int GetBinIdInReducedSpectrogramForHerzValue(int herzValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | herzValue |
Returns
| Type | Description |
|---|---|
| Int32 |
GetLinearBinBounds()
Returns an [N, 2] matrix with bin ID in column 1 and lower Herz bound in column 2.
Declaration
public int[, ] GetLinearBinBounds()
Returns
| Type | Description |
|---|---|
| Int32[,] |
GetLinearFreqScale(Int32, Int32)
THis method assumes that the frameSize will be power of 2 FOR DEBUG PURPOSES, when sr = 22050 and frame size = 8192, the following Hz are located at index: Hz Index 15 6 31 12 62 23 125 46 250 93 500 186 1000 372.
Declaration
public static double[] GetLinearFreqScale(int nyquist, int binCount)
Parameters
Returns
| Type | Description |
|---|---|
| Double[] |
GetLinearGridLineLocations(Int32, Int32, Int32)
T.
Declaration
public static int[, ] GetLinearGridLineLocations(int nyquist, int herzInterval, int binCount)
Parameters
Returns
| Type | Description |
|---|---|
| Int32[,] |