downsample
Reducing the sampling rate by an integer number of times.
| Library |
|
Arguments
Input arguments
# x — input array
+
vector | the matrix
Details
An input array specified as a vector or matrix. If x — matrix, the function treats columns as independent channels.
#
n is
the sampling rate reduction
factor
a positive integer
Details
The sampling rate reduction factor, set as a positive integer.
| Типы данных |
|
Output arguments
#
y —
array with a reduced sampling
rate
vector | the matrix
Details
An array with a reduced sampling rate, returned as a vector or matrix.
Examples
Reducing the sampling rate
Details
Reduce the sampling rate of the sequence to 3 times.
import EngeeDSP.Functions: downsample
x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
y = downsample(x, 3)
4-element Vector{Int64}:
1
4
7
10
Reduce the sampling rate of the sequence to 3 once and add the phase offset to 2 times.
y = downsample(x, 3, 2)
3-element Vector{Int64}:
3
6
9
Reduce the sampling rate of the matrix to 3 times.
x = [1 2 3; 4 5 6; 7 8 9; 10 11 12]
y = downsample(x, 3)
2×3 Matrix{Int64}:
1 2 3
10 11 12