Table of Contents
Interpolation Tutorials
Introduction
Interpolation, also known as upsampling in the case of Digital Signal Processing, is a process that provides an approximation of the signal that would have been obtained if it had been sampled at a higher sample rate.
Before continuing with this tutorial for further reading for understanding Interpolation read the following resources:
Materials Required
- Orbit Account
- Installation of GNURadio
- Reservation on Orbit Lab
- WAV File
Installing GNURadio
If running on a Ubuntu or Debian distribution of Linux use the following command for installation:
sudo apt-get install gnuradio
For other OS's follow the instructions from this guide.
Interpolation of a Sinusoidal Wave with GNURadio
In GNURadio on your computer implement the following flow chart to obtain the following FFT and Scope Plots:
Next add a Interpolation FIR Filter with an Interpolation of 3 as seen below:
Verify that the Scope and FFT plots are:
The waveforms can be seen with 3 zeros inserted from the Interpolation FIR Filter between every sampled point. Next apply a Low Pass Filter as seen below to smooth out the waveform.
Verify that the smoothed out signal plots resemble:
Interpolation of a .WAV File with GNURadio
For the following download the .WAV File and listen to the audio file. Then set up the following flowgraph in GNURadio:
Go back to the original .WAV File and listen to the audio. Then listen to the output file and notice the difference and effects of upsampling an audio sample.
Interpolation of a Sinusoidal Wave with Octave
To start off make a simple sine wave
signal = sin(2*pi*3.*[0:.01:1]); plot(signal);
Then continue by entering
signal_zeropadded = [signal;zeros(3,length(signal))]; signal_zeropadded = signal_zeropadded(:); pkg load signal b = fir1(10,.12); signal_interpolated=filter(b,1,signal_zeropadded); plot(signal_interpolated)
Interpolation of a .WAV File with Octave
To start off with interpolation of a wav file download the island.wav file in the files attached below and load up Octave. Enter the following afterwards:
[signal, fs] = auload("island.wav"); signal_zeropadded = [signal;zeros(3,length(fs))]; signal_zeropadded = signal_zeropadded(:); pkg load signal b = fir1(10,.12); signal_interpolated = filter(b,1,signal_zeropadded); plot(signal_interpolated)
The plot should look like
Then to save the interpolated signal as a .WAV file with the following command
wavwrite(signal_interpolated, 'islands.wav');
Troubleshooting
Audio Package
If your receive an error stating that you don't have the audio package in Octave you will need to install the following package.
sudo octave pkg install -forge audio
If this tells you to install liboctave-dev, in a different terminal enter
sudo apt-get install liboctave-dev
then retry the above steps for package installation.
To verify that you have the package installed you can enter
pkg list
and should see the following
The audio package uses external software to play and record audio. The following should be sufficient.
sudo apt-get install sox
Signal Package
If you receive the following error
you will need to install the signal package.
To install the signal package you will need to use the following commands
sudo octave pkg install -forge signal
If you receive the following error:
you will need to install the control package with the command
pkg install -forge control
Then redo the package installation for the signal package.
Attachments (18)
- img1.png (38.1 KB ) - added by 10 years ago.
- img2.png (16.8 KB ) - added by 10 years ago.
- img3.png (19.2 KB ) - added by 10 years ago.
- img4.png (41.6 KB ) - added by 10 years ago.
- img5.png (15.5 KB ) - added by 10 years ago.
- img6.png (14.4 KB ) - added by 10 years ago.
- img7.png (48.6 KB ) - added by 10 years ago.
- img8.png (15.5 KB ) - added by 10 years ago.
- img9.png (12.6 KB ) - added by 10 years ago.
- img10.png (25.6 KB ) - added by 10 years ago.
- island.wav (135.1 KB ) - added by 10 years ago.
- pkglist.png (10.3 KB ) - added by 9 years ago.
- fir1_err.png (21.9 KB ) - added by 9 years ago.
- load_err.png (26.6 KB ) - added by 9 years ago.
- sig_interpolated.png (16.5 KB ) - added by 9 years ago.
- signal_err.png (6.3 KB ) - added by 9 years ago.
- sine.png (7.0 KB ) - added by 9 years ago.
- sine_interpolated.png (8.3 KB ) - added by 9 years ago.
Download all attachments as: .zip