<< Chapter < Page Chapter >> Page >

Now use these functions to calculate the impulse response of each of the following 5 systems: S 1 , S 2 , S 1 ( S 2 ) (i.e., the series connection with S 1 following S 2 ), S 2 ( S 1 ) (i.e., the series connection with S 2 following S 1 ), and S 1 + S 2 .

For each of the five systems, draw and submit a system diagram (use only delays,multiplications and additions as in [link] ). Also submit plots of each impulse response.Discuss your observations.

Audio filtering

For this section download the music.au file. For help on how to play audio signals click here .

Use the command auread to load the file music.au into Matlab. Then use the Matlab function sound to listen to the signal.

Next filter the audio signal with each of the two systems S 1 and S 2 from the previous section. Listen to the two filtered signals.

How do the filters change the sound of the audio signals? Explain your observations.

Inverse systems

Consider the system y = S 2 [ x ] from the "Difference Equations" section. Find a difference equation for a newsystem y = S 3 [ x ] such that δ = S 3 [ S 2 [ δ ] ] where δ denotes the discrete-time impulse function δ ( n ) . Since both systems S 2 and S 3 are LTI, the time-invariance and superposition properties can be used to obtain x = S 3 [ S 2 [ x ] ] for any discrete-time signal x . We say that the systems S 3 and S 2 are inverse filters becausethey cancel out the effects of each other.

Hint: The system y = S 3 [ x ] can be described by the difference equation

y ( n ) = a x ( n ) + b x ( n - 1 )

where a and b are constants.

Write a Matlab function y = S3(x) which implements the system S 3 . Then obtain the impulse response of both S 3 and S 3 [ S 2 [ δ ] ] .

Draw a system diagram for the system S 3 , and submit plots of the impulse responsesfor S 3 and S 3 ( S 2 ) .

System tests

For this section download the zip file bbox.zip .

Often it is necessary to determine if a system is linear and/or time-invariant. If the inner workings of a system are not known, this task is impossiblebecause the linearity and time-invariance properties must hold true for all possible inputs signals.However, it is possible to show that a system is non-linear or time-varying because only a single instance must be found where the properties are violated.

The zip file bbox.zip contains three "black-box" systems in the files bbox1.p, bbox2.p, and bbox3.p.These files work as Matlab functions, with the syntax y=bboxN(x) , where x and y are the input and the output signals, and N = 1, 2 or 3 . Exactly one of these systems is non-linear, and exactly one ofthem is time-varying. Your task is to find the non-linear system and the time-varyingsystem.

    Hints:

  1. You should try a variety of input signals until you find a counter-example.
  2. When testing for time-invariance, you need to look at the responses to a signal and to its delayed version. Since all your signals in MATLABhave finite duration, you should be very careful about shifting signals. In particular, if you want to shift a signal x by M samples to the left, x should start with at least M zeros. If you want to shift x by M samples to the right, x should end with at least M zeros.
  3. When testing for linearity, you may find that simple inputs such as the unit impulse do not accomplish the task. In this case, you shouldtry something more complicated like a sinusoid or a random signal generated with the random command.
State which system is non-linear, and which system is time-varying. Submit plots of input/output signal pairs that support yourconclusions. Indicate on the plots why they support your conclusions.

Stock market example

For this section download stockrates.mat . For help on loading Matlab files click here .

Load stockrates.mat into Matlab. This file contains a vector, called rate , of daily stock market exchange rates for a publicly traded stock.

Apply filters [link] and [link] from the "Stock Market Example" section of the background exercises to smooth the stock values. When you apply the filter of [link] you will need to initialize the value of avgvalue(yesterday) . Use an initial value of 0.Similarly, in [link] , set the initial values of the "value" vector to 0 (for the days prior to the start of data collection).Use the subplot command to plot the original stock values, the result of filtering with [link] , and the result of filtering with [link] .

Submit your plots of the original and filtered exchange-rates. Discuss the advantages and disadvantagesof the two filters. Can you suggest a better method for initializing the filter outputs?

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Purdue digital signal processing labs (ece 438). OpenStax CNX. Sep 14, 2009 Download for free at http://cnx.org/content/col10593/1.4
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Purdue digital signal processing labs (ece 438)' conversation and receive update notifications?

Ask