(I) Downsample
Reduce the sampling rate by an integer multiple
Reduce the sampling rate by an integer multiple
- syntax
y =downsample (x, n)
y =downsample (x, n, phase) y =downsample (x, n) reduces the sampling rate of x by retaining the first sample and then the NTH sample after the first sample. If x is a matrix, the function treats each column as a separate sequence. Y = Downsample (x, n, phase) specifies the number of samples for the sampling sequence under offset. Example 1:
reduces the sampling rate of the sequence by a factor of 3. x = [1 2 3 4 5 6 7 8 9 10];
y =downsample (x, 3)
y = 1×4 1 4 7 10 example 2: reduce the sampling rate of the sequence by 3 times and increase the phase offset by 2. That is to offset two Numbers backward from the first number for downsampling y =downsample (x, 3, 2)
y = 1×3 3 6 9
x1 = [1 2 3 4 5 6 7 8 9];
y =downsample(x1,3,1) y = 2 5 8
example 3:
reduces the sampling rate of the matrix by 3 times. X = [1 2 3;
4 5 6;
7 8 9;
10, 11 12];
y =downsample (x, 3)
y = 2×3 12 3
10 11 12 input parameters
x — input array
vector | matrix
input array, specified as a vector or matrix. If x is a matrix, the function treats the columns as independent channels. Example: Cosine (PI/4 * (0:15 9)) + RANDn (1,160) specifies the sine curve plus the White Gaussian noise. Example: cos (PI./ [4; 2] * (0:15 9)) ‘+ randn (160,2) specifies a two-channel sine wave. Data type: single | double
complex number support: is
n – down sampling coefficient
positive integer
under sampling factor, specified as a positive integer. Data type: single | double
phase – offset
(default) | positive integer
offset, specified as a positive integer between 0 and n-1. Data type: single | double output parameter
y – down sampling array
vector | matrix
down sampling array, returned as a vector or matrix.
Read More:
- R language notes – sample() function
- matlab Error Subscript indices must either be real positive integers or logicals.
- Can’t multiply sequence by non int of type ‘float’
- [solved] error: valueerror: expected 2D array, got scalar array instead
- Empty Matrices, Scalars, and Vectors
- Use of rep function in R
- Finding the longest connection path of a string
- tf.layers.conv1d Function analysis (one dimensional convolution)
- How to wrap a long string in MATLAB
- Matlab: Three forms of random number generated (Rand, Randi and Randn)
- Getting started with jmu-java-m01-scanner
- ValueError: Integers to negative integer powers are not allowed.
- Java long type error: error: integer number too large
- Error: improvement of not enough values to unpack (expected 2, got 1)
- 7. Reverse Integer [easy] (Python)
- The problem that the normal of the model is no longer perpendicular to the surface after unequal scaling
- Leetcode solution 189 Rotate Array Java version
- libxx.so: undefined reference, vector.reserve(n) [How to Solve]
- [Python] numpy library array splicing np.concatenate Detailed explanation and examples of official documents
- 【R】【unimplemented type ‘list’ in ‘orderVector1’】