In: Electrical Engineering
Interpolation Filters. Write a Matlab program to read and upsample the linked voice_samp_8k.wav file (below -- sampled at Fs=8000 samples per second) by an integer factor L (you can choose, probably in the range from 3 to 7 or so). Then use interpolation filtering to produce the following outputs and listen to them and plot short segments (~50-100 samples) of these outputs: (i) upsample only with no interpolation filtering, (ii) hold interpolation implemented directly as a causal FIR filter, (iii) linear interpolation implemented directly as a causal FIR filter, and two other designed FIR lowpass interpolation filtering with (iv) shorter (~20-200) FIR filters and (v) longer (~200-2000) FIR filters that you design with fir1(). Verify that your program is doing what you want by looking at plots of the various outputs. Also note any interesting observations.
%%--------------------------------------------------below is the matlab code for--------------------------%%
load chirp.mat; % sound signal
sound(y, Fs);
L= 5 % factor
sysl = interp(y,L);
subplot 211
plot(y')
grid on
xlabel 'Sample number',ylabel Original
subplot 212
plot(sysl')
grid on
xlabel 'Sample number',ylabel Interpolated
%%----------------------------------------------------%%
upfac = 5;
alpha = 0.5;
h1 = intfilt(upfac,2,alpha); % digital interpolation filter to
upsample a signal by seven
lowp = fir1(40,alpha); % fir filter with order 40
x = filter(lowp,1,y); % apply filter on original signal
xr = upsample(x,upfac);
yy = filter(h1,1,xr); % apply filter
plot(yy)
grid on
xlabel('Sample number')
ylabel ('Interpolated with fir order 40')
%---------------------------------------------------%%
upfac = 5;
alpha = 0.5;
h1 = intfilt(upfac,2,alpha); % digital interpolation filter to
upsample a signal by seven
lowp = fir1(250,alpha); % fir filter with order 250
x = filter(lowp,1,y); % apply filter on original signal
xr = upsample(x,upfac);
yy = filter(h1,1,xr); % apply filter
plot(yy)
xlabel('Sample number')
ylabel ('Interpolated with fir order 250')
%%-----------------------------------code---end-------------------------%%