Question

In: Electrical Engineering

Interpolation Filters. Write a Matlab program to read and upsample the linked voice_samp_8k.wav file (below --...

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.

Solutions

Expert Solution

%%--------------------------------------------------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-------------------------%%


Related Solutions

Done in C++, Write a program to read the input file, shown below and write out...
Done in C++, Write a program to read the input file, shown below and write out the output file shown below. Use only string objects and string functions to process the data. Do not use c-string functions or stringstream (or istringstream or ostringstream) class objects for your solution. Input File Cincinnati 27, Buffalo 24 Detroit 31, Cleveland 17 Kansas City 24, Oakland 7 Carolina 35, Minnesota 10 Pittsburgh 19, NY Jets 6 Philadelphia 31, Tampa Bay 20 Green Bay 19,...
Write a Fortran program that is able to read in the data file. The file has...
Write a Fortran program that is able to read in the data file. The file has lines with the structure: 19990122 88888 30.5 Where: i) the first is an 8 digit code with the date: yyyymmdd (yyyy is the year, mm is the month, and dd is the day) ii) the second is the five digit odometer reading of a car iii) the third is the amount of fuel put into the car on that date to fill the tank...
Using OOP, write a C++ program that will read in a file of names. The file...
Using OOP, write a C++ program that will read in a file of names. The file is called Names.txt and should be located in the current directory of your program. Read in and store the names into an array of 30 names. Sort the array using the selection sort or the bubblesort code found in your textbook. List the roster of students in ascending alphabetical order. Projects using global variables or not using a class and object will result in...
Please write a java program to write to a text file and to read from a...
Please write a java program to write to a text file and to read from a text file.
Write a program in python to read from a file the names and grades of a...
Write a program in python to read from a file the names and grades of a class of students to calculate the class average, the maximum, and the minimum grades. The program should then write the names and grades on a new file identifying the students who passed and the students who failed. The program should consist of the following functions: a) Develop a getGrades() function that reads data from a file and stores it and returns it as a...
Could you write a c- program that reads a text file into a linked list of...
Could you write a c- program that reads a text file into a linked list of characters and then manipulate the linked list by making the following replacements 1. In paragraph 1 Replace all “c” with “s” if followed by the characters “e”, “i” or “y”; otherwise 2. In pragraph 2 Replace "We" with v"i" This is the text to be manipulated: Paragraph1 She told us to take the trash out. Why did she do that? I wish she would...
Could you write a c- program that reads a text file into a linked list of...
Could you write a c- program that reads a text file into a linked list of characters and then manipulate the linked list by making the following replacements 1. Replace all “c” with “s” if followed by the characters “e”, “i” or “y”; otherwise 2. Replace "sh" with ph This is the text to be manipulated: Paragraph1 She told us to take the trash out. Why did she do that? I wish she would not do that Paragraph 2 We...
Program in Bash: Write a program using bash script that can read a file from the...
Program in Bash: Write a program using bash script that can read a file from the same directory, sort the nonrepeating integers from 0-9 from smallest to largest, and output the results on the same line. Do not use the sort function.
Program in Bash: Write a program using bash script that can read a file from the...
Program in Bash: Write a program using bash script that can read a file from the same directory, sort the nonrepeating integers from 0-9 from smallest to largest, and output the results on the same line. Do not use the sort function.
Python program: Write a program that reads a text file named test_scores.txt to read the name...
Python program: Write a program that reads a text file named test_scores.txt to read the name of the student and his/her scores for 3 tests. The program should display class average for first test (average of scores of test 1) and average (average of 3 tests) for each student. Expected Output: ['John', '25', '26', '27'] ['Michael', '24', '28', '29'] ['Adelle', '23', '24', '20'] [['John', '25', '26', '27'], ['Michael', '24', '28', '29'], ['Adelle', '23', '24', '20']] Class average for test 1...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT