1、upsample
Increase sampling rate by integer factor
Syntax
y=upsample(x,n)
y=upsample(x,n,phase)
Description
y = upsample(x,n)increases the sampling rate ofxby insertingn-1 zeros between samples.xcan be a vector or a matrix. Ifxis a matrix, each column is considered a separate sequence. The upsampledyhasx*nsamples.
y = upsample(x,n,phase)specifies the number of samples by which to offset the upsampled sequence.phasemust be an integer from 0 ton-1.
Examples
Increase the sampling rate of a sequence by 3:
x = [1 2 3 4];
y = upsample(x,3);
x,y
x =
1 2 3 4
y =
1 0 0 2 0 0 3 0 0 4 0 0
Increase the sampling rate of the sequence by 3 and add a phase offset of 2:
x = [1 2 3 4];
y = upsample(x,3,2);
x,y
x =
1 2 3 4