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

  Characterization technology for nanomaterials

Calculate the reciprocal lattice of the body-centred cubic and Show that the reciprocal of the face-centred cubic (fcc) structure is itself a bcc structure.

  Calculate the gasoline savings

How much gasoline do vehicles with the following fuel efficiencies consume in one year? Calculate the gasoline savings, in gallons per year, created by the following two options. Show all your work, and draw boxes around your answers.

  Design and modelling of adsorption chromatography

Design and modelling of adsorption chromatography based on isotherm data

  Application of mechatronics engineering

Write an essay on Application of Mechatronics Engineering

  Growth chracteristics of the organism

To examine the relationship between fermenter design and operating conditions, oxygen transfer capability and microbial growth.

  Block diagram, system performance and responses

Questions based on Block Diagram, System Performance and Responses.

  Explain the difference in a technical performance measure

good understanding of Mil-Std-499 and Mil-Std-499A

  Electrode impedances

How did this procedure affect the signal observed from the electrode and the electrode impedances?

  Write a report on environmental companies

Write a report on environmental companies

  Scanning electron microscopy

Prepare a schematic diagram below of the major parts of the SEM

  Design a pumping and piping system

creating the pumping and piping system to supply cool water to the condenser

  A repulsive potential energy should be a positive one

Using the data provided on the webvista site in the file marked vdw.txt, try to develop a mathematical equation for the vdW potential we discussed in class, U(x), that best fits the data

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