C# Класс Accord.Audio.Signal

Represents a PCM sound discrete signal (measured in time). A real discrete-time signal is defined as any real-valued function of the integers.

In signal processing, sampling is the reduction of a continuous signal to a discrete signal. A common example is the conversion of a sound wave (a continuous-time signal) to a sequence of samples (a discrete-time signal).

A sample refers to a value or set of values at a point in time and/or space.

Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CopyTo ( Array array ) : void

Copies this signal to a given array.

CopyTo ( double array ) : void

Copies this signal to a given array.

CopyTo ( float array ) : void

Copies this signal to a given array.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

DurationOfSamples ( int samples, int samplingRate ) : int

Gets the duration of each sample in a signal with the given number of samples and sampling rate.

FromArray ( Array signal, int sampleRate, SampleFormat format = SampleFormat.Format32BitIeeeFloat ) : Signal

Creates a new Signal from a float array.

FromArray ( Array signal, int channels, int sampleRate, SampleFormat format = SampleFormat.Format32BitIeeeFloat ) : Signal

Creates a new Signal from a float array.

FromArray ( Array signal, int size, int channels, int sampleRate, SampleFormat format = SampleFormat.Format32BitIeeeFloat ) : Signal

Creates a new Signal from a float array.

GetEnergy ( ) : double

Computes the signal energy.

GetSample ( int channel, int position ) : float

Gets the value of the specified sample in the Signal.

GetSampleSize ( SampleFormat format ) : int

Gets the size (in bits) of a sample format.

NumberOfSamples ( int duration, int samplingRate ) : int

Gets the number of samples contained in a signal of given duration and sampling rate.

SetSample ( int channel, int position, float value ) : void

Sets the value of the specified sample in the Signal.

Signal ( byte data, int channels, int length, int sampleRate, SampleFormat format ) : System

Constructs a new signal.

Signal ( int channels, int length, int sampleRate, SampleFormat format ) : System

Constructs a new Signal.

ToComplex ( ) : ComplexSignal

Converts this signal to a ComplexSignal object.

ToDouble ( ) : double[]

Converts this signal into a array of floating-point samples.

ToFloat ( ) : float[]

Converts this signal into a array of floating-point samples.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources

Приватные методы

Метод Описание
init ( byte data, int channels, int length, int sampleRate, SampleFormat format ) : void

Описание методов

CopyTo() публичный метод

Copies this signal to a given array.
public CopyTo ( Array array ) : void
array System.Array
Результат void

CopyTo() публичный метод

Copies this signal to a given array.
public CopyTo ( double array ) : void
array double
Результат void

CopyTo() публичный метод

Copies this signal to a given array.
public CopyTo ( float array ) : void
array float
Результат void

Dispose() публичный метод

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Результат void

Dispose() защищенный метод

Releases unmanaged and - optionally - managed resources
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed /// and unmanaged resources; false to release only unmanaged /// resources.
Результат void

DurationOfSamples() публичный статический метод

Gets the duration of each sample in a signal with the given number of samples and sampling rate.
public static DurationOfSamples ( int samples, int samplingRate ) : int
samples int
samplingRate int
Результат int

FromArray() публичный статический метод

Creates a new Signal from a float array.
public static FromArray ( Array signal, int sampleRate, SampleFormat format = SampleFormat.Format32BitIeeeFloat ) : Signal
signal System.Array
sampleRate int
format SampleFormat
Результат Signal

FromArray() публичный статический метод

Creates a new Signal from a float array.
public static FromArray ( Array signal, int channels, int sampleRate, SampleFormat format = SampleFormat.Format32BitIeeeFloat ) : Signal
signal System.Array
channels int
sampleRate int
format SampleFormat
Результат Signal

FromArray() публичный статический метод

Creates a new Signal from a float array.
public static FromArray ( Array signal, int size, int channels, int sampleRate, SampleFormat format = SampleFormat.Format32BitIeeeFloat ) : Signal
signal System.Array
size int
channels int
sampleRate int
format SampleFormat
Результат Signal

GetEnergy() публичный метод

Computes the signal energy.
public GetEnergy ( ) : double
Результат double

GetSample() публичный метод

Gets the value of the specified sample in the Signal.
public GetSample ( int channel, int position ) : float
channel int The channel's index of the sample to set.
position int The position of the sample to set.
Результат float

GetSampleSize() публичный статический метод

Gets the size (in bits) of a sample format.
public static GetSampleSize ( SampleFormat format ) : int
format SampleFormat
Результат int

NumberOfSamples() публичный статический метод

Gets the number of samples contained in a signal of given duration and sampling rate.
public static NumberOfSamples ( int duration, int samplingRate ) : int
duration int
samplingRate int
Результат int

SetSample() публичный метод

Sets the value of the specified sample in the Signal.
public SetSample ( int channel, int position, float value ) : void
channel int The channel's index of the sample to set.
position int The position of the sample to set.
value float A floating-point value ranging from -1 to 1 /// specifying the value to set. Conversion will be done automatically /// to the underlying signal sample format if supported.
Результат void

Signal() публичный метод

Constructs a new signal.
public Signal ( byte data, int channels, int length, int sampleRate, SampleFormat format ) : System
data byte The raw data for the signal.
channels int The number of channels for the signal.
length int The length of the signal.
sampleRate int The sample date of the signal.
format SampleFormat The sample format for the signal.
Результат System

Signal() публичный метод

Constructs a new Signal.
public Signal ( int channels, int length, int sampleRate, SampleFormat format ) : System
channels int The number of channels for the signal.
length int The length of the signal.
sampleRate int The sample date of the signal.
format SampleFormat The sample format for the signal.
Результат System

ToComplex() публичный метод

Converts this signal to a ComplexSignal object.
public ToComplex ( ) : ComplexSignal
Результат ComplexSignal

ToDouble() публичный метод

Converts this signal into a array of floating-point samples.
public ToDouble ( ) : double[]
Результат double[]

ToFloat() публичный метод

Converts this signal into a array of floating-point samples.
public ToFloat ( ) : float[]
Результат float[]