Design and implement a routine that will resample

Assignment Help Other Engineering
Reference no: EM13860325

PURPOSE

The purpose of this laboratory is to design and implement a routine that will resample (upsample and/or downsample) a sequence.

ASSIGNMENT

1. Answer in writing all the questions in the "Some questions" sections of the Downsampling and Upsampling links, above.
2. Write a MATLAB function, named resample, which has the following first lines:

function y = resamp(x, r)
% RESAMP Resample an input sequence x by a factor of r
% to produce an output sequence y by a combination of upsampling and downsampling.
% For example,
% y=resamp(x,1.5);
% will upsample x by 3 and downsample by 2.

o x is just an plain-vanilla array, not one of our Matlab sequence structures.

o You may want to look at the MATLAB function rat, which tries to express a rational number (such as the resampling parameter, r) as the ratio of integers.

o You may use the MATLAB functions fir1, filter and/or kaiser, to make your Kaiser filter only.

o Obviously you may not use the MATLAB resample, decimate, or interpolate functions. However, you should feel free to use these functions to check your resamp function. You should read about making the Kaiser filter here.

o You will want to make sure that the bandwidth and gain of your Kaiser filter are correct, given the value of your resampling parameter, r.

o You may use MATLAB's conv routine if you wish.

3. Test your resamp against MATLAB's resample function. Since MATLAB's resample function may use a different lowpass filter, we can't simply compare point by point.

However, we can look at the output of the two functions for a simple sinusoidal input to see that it does the right thing. Here is a small program called test_resamp to do just that. What test_resamp does is to take an input sequence and plot the first few points resampled by a given factor using both Matlab's resample function and your test_resamp function. To use test_resamp, just put it in the directory with your resamp function, and run it. For example, to test upsampling of a little sin sequence by a factor of two, just do this:

>> x = -sin(2 * pi * (0:10) / 4);

>> test_resamp(x, 2);

1444_resamp function.png

The output of your resamp function is in blue and the output of matlab's resample function is in red. They should match very well. You can do help test_resamp to find out the other arguments of the function.

4. Test your resamp function by upsampling or downsampling a segment of speech. You can get this sample in several ways:

o Take my speech sample, seashell .wav, which we played earlier.

o Find another . wav file on the net

o Record your own . wav file.

5. Once you have a .wav file, read the data into your program using MATLAB's wavread function.

6. Resample x to some other, non-integer rate, using your resamp function: y = resamp(x, 1.5);

7. To check that you resampled correctly, playback the resampled signal using the ,,oundsc function at the new sample rate, for example: soundsc(resamp(x, 1.5), 1.5 * fs);

The resampled function should sound very similar to the original function, at least if it is upsampled.

8. You should download the following file and put it in your directory : lab5.m. Then type publish lab5, print the output, and submit it.

Reference no: EM13860325

Questions Cloud

Calculate the profit each year using variable costing : Calculate the profit each year using variable costing. Explain why profit does not fluctuate from year to year using variable costing.
Calculate the cost-use of material sold for the material : Calculate the cost-use of material sold for the material(energy): Based on the following evaluation methods: - FIFO - HIFO - LIFO - average price
Find the additional dimensionless number : If in the case of gas flows, the heat transfer coefficient is assumed to depend on the speed of sound, a, in the gas in addition to the variables considered in chapter one of the book (Introduction to Convection Heat Transfer Analysis, P. Oosthuiz..
How were the risks handled or mitigated? : How were these risks handled or mitigated?
Design and implement a routine that will resample : The purpose of this laboratory is to design and implement a routine that will resample (upsample and/or downsample) a sequence.
What have you learned from others responses : What were the most compelling points from the interaction with your fellow students and how did participating in this discussion help in your understanding of the Discussion Board task?
How does each theory affect the views of the individual : How does each theory affect the views of the individual who is part of health care?
Determine all income statement line item amounts : Determine all income statement line item amounts necessary to prepare Student Inc. income statement starting from "income from continuing operations before tax and extraordinary items" through "net income".
Compute the sales forecast : Clyde's Chairs and Things sells custom made chairs. Yearly sales from 1983 to 2011 are provided below. After analyzing the information, answer the following questions as completely as possible:

Reviews

Write a Review

Other Engineering Questions & Answers

  What is the water content of thefines in the compacted mass

The fines have a PL = 22 and an LL = 34. Thismixture is compacted by rolling to ?d = 128 pcf and wmix = 13%. What is the water content of thefines in the compacted mass?

  When was the mouldboard plough invented

When was the mouldboard plough invented and by who. also, what exactly is it.

  Problems based on complex exponentials

Difference Equations:  Solve the following difference equation using recursion by hand (for n=0 to n=4)

  What control signals does the microcontroller send out when

8. a in the normal expanded wide mode or the normal expanded narrow mode the mc9s12dp256b microcontroller can fetch

  Environmental engineeringquestion 1 although it is rarely

environmental engineeringquestion 1 although it is rarely considered as such sulfur could potentially be a limiting

  Which is the preferred environmental condition

Which is the preferred environmental condition for handling electronic components that are ESD sensitive -  Higher relative humidity (RH) environment

  Create a presentation of an ideal performance management sys

Create a presentation of an ideal performance management system

  Problem - loan services at a bank

Will hiring the second loan expert decrease the average total time a customer spends in the bank for completing his/her loan request - Human Resources Manager suggested replacing the current loan expert with a new one.

  What does one measure with an ise

Does one need to calibrate an Ion Selective Electrode (ISE)? Why and what does one measure with an ISE?

  Find the total fuel flow

Find the Total Fuel Flow to maintain Max endurance speed in Level flight at FL350 - What would the % thrust and % N1 setting be at Max Endurance Speed, FL350?

  Comparison of d-type versus j-k flip-flops

The most common use for the NAND latch is as a switch debouncer. What is switch bounce, and why do we need to eliminate it?

  Green cross-docking

how you determine the expected amount of CO2 generated per hour due to inbound operations when you start using forklift alternative 1?- Define the queueing system by describing the customers.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd