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

  Henry clements car rental agency case study

How many cars will need to be moved and what will the total cost of the move be?

  Adopt a condensing power plant

Adopt a condensing power plant with a feedwater tank (MV) with the wiring diagram and information - High-pressure turbines are isentropic efficiency of 0.88.

  Plot a graph using scilab script and include it in

Prepare a Scilab script to evaluate the volumetric flux of smoke in a plume produced by a fire of given HRR Q'' The plume loses a percent of its heat by radiation and ß percent by other means.

  Calculate the change rates in orbital elements

Provide a qualitative sketch of the co-rotating coordinate system of Neptune/Triton and calculate the location of the origin of this coordinate system.

  How facebook is changing our way of communication

How is Facebook changing our way of communication and how has Facebook changed our cultures

  Advantages of wireless sensor networks to alleviate problem

The alerts are delivered to smartphones or street signs. Identify the advantages and disadvantages of using wireless sensor networks to alleviate the problem

  Vulnerability in the marketplace of downloaded applications

Summarise your findings from your research of NFC. Consider the possible simple communication configurations between two devices A and B, and identify possible applications for NFC for each configuration.

  What measurements can possibly be made

What measurements can possibly be made in order to determine if corrosion is taking place and what is a salt bridge? What purpose does it serve? With respect to ORP analyzer

  Find the number of strongly connected components

Find the number of strongly connected components in the graph and compute the in-degree centralization of the graph and compute the modularity score associated with that community structure in G.

  Provide background information that helps in analyzing data

provide background information that helps in analyzing your data. You should include theoretical information for all of the equations that you used in analyzing your data.

  Define constraints and objective function accordingly

Formulate a linear programming model for this problem. Define decision variables, and then define your constraints and objective function accordingly.

  Write a position piece on the future of energy storage

Write a position piece on the future of energy storage. The length of the article should be maximum 10 sentences and should concentrate on predicting which energy storage technology will experience the highest growth till 2030 and why

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