Changes between Version 3 and Version 4 of DSP/Interpolation


Ignore:
Timestamp:
Aug 4, 2015, 7:00:27 AM (9 years ago)
Author:
dlambros
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • DSP/Interpolation

    v3 v4  
    5353Go 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.
    5454== Interpolation of a Sinusoidal Wave with Octave ==
     55To start off make a simple sine wave
     56{{{
     57signal = sin(2*pi*3.*[0:.01:1]);
     58plot(signal);
     59}}}
     60[[Image(sine.png, 500px)]]
    5561
     62Then continue by entering
     63{{{
     64signal_zeropadded = [signal;zeros(3,length(signal))];
     65signal_zeropadded = signal_zeropadded(:);
     66pkg load signal
     67b = fir1(10,.12);
     68signal_interpolated=filter(b,1,signal_zeropadded);
     69plot(signal_interpolated)
     70}}}
     71[[Image(sine_interpolated.png, 500px)]]
     72== Interpolation of a .WAV File with Octave ==
     73{{{
     74[signal, fs] = auload("island(1).wav");
     75signal_zeropadded = [signal;zeros(3,length(fs))];
     76signal_zeropadded = signal_zeropadded(:);
     77pkg load signal
     78b = fir1(10,.12);
     79signal_interpolated = filter(b,1,signal_zeropadded);
     80plot(signal_interpolated)
     81}}}
    5682
     83The plot should look like
     84
     85[[Image(sig_interpolated.png, 500px)]]
     86
     87Then to save the interpolated signal as a .WAV file with the following command
     88{{{
     89wavwrite(signal_interpolated, 'islands.wav');
     90}}}
    5791== Troubleshooting ==
    5892
     
    81115and should see the following
    82116
    83 [[Image(pkglist.png, 650px)]]
     117[[Image(pkglist.png, 500px)]]
    84118
    85119
     
    93127If you receive the following error
    94128
    95 [[Image(fir1_err.png, 650px)]]
     129[[Image(fir1_err.png, 500px)]]
    96130
    97131you will need to install the signal package.
     
    104138
    105139If you receive the following error:
    106 [[Image(signal_err.png, 650px)]]
     140
     141[[Image(signal_err.png, 500px)]]
     142
    107143you will need to install the control package with the command
    108144{{{