Skip to content

Resample

Sambit Paul edited this page Sep 21, 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(this.signal, 100);
double[] resampled = rs.resampleSignal();

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

signal

The Polyphase Filtering Method

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

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

signal

Clone this wiki locally