This example upsamples a sinusoidal signal by a ratio of 5/2 using a polyphase lowpass interpolating FIR filter.

View the signal before and after filtering. The horizontal axis in each plot shows the number of samples.

This universe generates a sine wave using the singen galaxy and feeds it into an FIR star with parameters set to upsample by a ratio of 5/2 (the lower path). The FIR star internally uses a polyphase filter structure for efficient computation. Along the upper path, a functionally equivalent, but less efficient implementation uses UpSample and DownSample stars.

Because of properties of synchronous dataflow scheduling, when you run this universe for 25 iterations, you get 50 samples of the input signal and 125 samples (5/2 times as many) of the output signal. The filter in the FIR star is a lowpass with its cutoff frequency at 1/20th of the sample rate. In this case, the sample rate in question is five times the input sample rate, which is equal to twice the output sample rate. The low cutoff conservatively prevents aliasing due to the sample rate conversions. The filter was designed using the optfir program, which can be invoked through the pigi menu.


Last updated 5/16/94.