C# Class 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.

Inheritance: IDisposable
Afficher le fichier Open project: accord-net/framework Class Usage Examples

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources

Private Methods

Méthode Description
init ( byte data, int channels, int length, int sampleRate, SampleFormat format ) : void

Method Details

CopyTo() public méthode

Copies this signal to a given array.
public CopyTo ( Array array ) : void
array System.Array
Résultat void

CopyTo() public méthode

Copies this signal to a given array.
public CopyTo ( double array ) : void
array double
Résultat void

CopyTo() public méthode

Copies this signal to a given array.
public CopyTo ( float array ) : void
array float
Résultat void

Dispose() public méthode

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

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.
Résultat void

DurationOfSamples() public static méthode

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
Résultat int

FromArray() public static méthode

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
Résultat Signal

FromArray() public static méthode

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
Résultat Signal

FromArray() public static méthode

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
Résultat Signal

GetEnergy() public méthode

Computes the signal energy.
public GetEnergy ( ) : double
Résultat double

GetSample() public méthode

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.
Résultat float

GetSampleSize() public static méthode

Gets the size (in bits) of a sample format.
public static GetSampleSize ( SampleFormat format ) : int
format SampleFormat
Résultat int

NumberOfSamples() public static méthode

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
Résultat int

SetSample() public méthode

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.
Résultat void

Signal() public méthode

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.
Résultat System

Signal() public méthode

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.
Résultat System

ToComplex() public méthode

Converts this signal to a ComplexSignal object.
public ToComplex ( ) : ComplexSignal
Résultat ComplexSignal

ToDouble() public méthode

Converts this signal into a array of floating-point samples.
public ToDouble ( ) : double[]
Résultat double[]

ToFloat() public méthode

Converts this signal into a array of floating-point samples.
public ToFloat ( ) : float[]
Résultat float[]