Resample - psambit9791/jdsp GitHub Wiki
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:
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.
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.