datacomm-lab - v1.2.0 › "signals/Signal" › Signal
export
class
Signal
-
Signal
+ new Signal(Fs
: number): Signal
Defined in signals/Signal.ts:11
Creates an instance of Signal.
memberof
Signal
Parameters:
Name | Type | Description |
---|---|---|
Fs |
number | Sampling frequency |
Returns: Signal
• get Fs(): number
Defined in signals/Signal.ts:55
Get the sampling frequency given as the length of the signal
readonly
type
{number}
memberof
Signal
Returns: number
• get signal(): number[]
Defined in signals/Signal.ts:31
Get the signal array
type
{number[]}
memberof
Signal
Returns: number[]
• set signal(signal
: number[]): void
Defined in signals/Signal.ts:40
Set the signal array
memberof
Signal
Parameters:
Name | Type |
---|---|
signal |
number[] |
Returns: void
▸ getBinaryThresholds(num_thresh
: number): number[]
Defined in signals/Signal.ts:135
First, samples the signal at the value specified by num_thresh. Then, resamples the new signal at the original signal sampling frequency, and converts each value to 1 (if the value is greater than 0) or 0 (if the value is less than or equal to zero).
memberof
Signal
Parameters:
Name | Type | Description |
---|---|---|
num_thresh |
number | Number of threshold points to represent |
Returns: number[]
Binary thresholds array
▸ getFrequencyResponse(): number[]
Defined in signals/Signal.ts:147
Returns the frequency magnitude response of the signal
memberof
Signal
Returns: number[]
Frequency magnitude response array
▸ getSignalValue(index
: number): number
Defined in signals/Signal.ts:66
Get the value of the signal at a sample value
memberof
Signal
Parameters:
Name | Type |
---|---|
index |
number |
Returns: number
▸ sample(Fs
: number): number[]
Defined in signals/Signal.ts:92
Returns the signal sampled at the given frequency. If the new sampling frequency is higher than the current signal sampling frequency, it must be a multiple of the current signal sampling frequency. If it is lower, it must be a factor of the current signal sampling frequency.
memberof
Signal
Parameters:
Name | Type | Description |
---|---|---|
Fs |
number | New sampling frequency |
Returns: number[]
Sampled signal array
▸ setSignalValue(index
: number, value
: number): void
Defined in signals/Signal.ts:77
Set the value of the signal at a sample value
memberof
Signal
Parameters:
Name | Type |
---|---|
index |
number |
value |
number |
Returns: void