Skip to content

Resample

Sambit Paul edited this page Sep 22, 2021 · 6 revisions

Resamples a signal to the provided number of samples. This is done in one of two ways --- using Fourier Transform or using Polyphase filtering.

The examples provided here use this signal:

signal

This signal has 20 datapoints; the objective is to increase the number of samples of this signal to 100 datapoints.

The Fourier Transform Method

CODE
Resample rs = new Resample(100);
double[] resampled = rs.resampleSignal(this.signal);

The following plot shows the output of resampling compared to the original signal.

fft_resample

The Polyphase Filtering Method

CODE
Resample rs = new Resample(100, 20, "constant");
double[] resampled = rs.resampleSignal(this.signal);

The following plot shows the output of resampling compared to the original signal.

poly_resample

Clone this wiki locally