Sumbul
Sumbul

Reputation: 167

matching the outputs of upsample and resample functions of matlab

i'm upsampling a signal from 100k to 30M samples using upsample function of MATLAB. But when i use resample function, the output is different.How can i use resample to get exact output like that of upsample function?

Upvotes: 1

Views: 144

Answers (1)

Itamar Katz
Itamar Katz

Reputation: 9645

You can't, as they do different things.

upsample just inserts zeros between your samples, while resample applies an anti-aliasing filter and then interpolates.

So for example, if your signal is x=[1,1], upsample(x,2) will output 1,0,1,0, while resmaple(x,2,1) outputs 1, 1.26, 1, 0.43, which is the result of filtering and interpolation.

Upvotes: 3

Related Questions