Question: We are often asked to confirm that a given filter design has the intended effect. This is often achieved using MATLAB or numpy ( or

We are often asked to confirm that a given filter design has the intended effect. This is often achieved using MATLAB or numpy (or any similar computational environment) using a white noise signalone that (approximately) contains all valid frequencies at approximately the same amplitude. In practice, we can generate this using a random number generator that produces random values between 0 and 1-in MATLAB this would be rand-shifting it to have a mean of zero (i.e., subtract 0.5 from all values, such that the mean is 0 and, therefore, x[0]=0), passing the resultant zero-
Page 2 of 3
BME 3020 C
Sensing and Measurement
Summer 2024
mean signal through the convolutional kernel, and then evaluating how the frequency spectrum of the output differs from that of the input. We will here evaluate your filter from Problem 2 in this manner.
a. First, use rand (or whatever is appropriate for your computational tooll) to generate a sequence of (at least)2048 random values having a zero mean. (If you are using MATLAB, just subtract 0.5 from all values in the vector!)
b. Use fft and fftshift to plot the magnitude of the frequency spectrum for your noise signal (i.e., what you generated in part a.). To make this a truly useful spectrum, you will want to use eftshift as well as to define an x-axis scale to use with plot. For this latter, recall that in an N-point DFT, the Nth value corresponds to FS(here taken to be 10 kHz ), and the value at N2 corresponds to one-half this value. Assuming you did not limit the length of the FFT performed, you should now have (at least)2048 values that are to be mapped to encompass fin[-FS2,FS2). Note that this particular range assumes you have used fftshift. Once you do have a magnitude spectrum that covers fin[-5000,5000)Hz, confirm the spectrum is "flat" in the sense that there is not a clear low-, high-, or band-pass/reject structure. (If so, re-run your random sequence generation process...you just got unlucky, which is improbable, but NOT impossible).
c. Convolve your noise signal with the convolutional kernel you generated in Problem 2. If you are using MATLAB, be sure to use the 'same' option with conv to trim the result to match the length of the noise signal. (Similar options exist in other computational environments!)
d. Plot the magnitude of the frequency spectrum for your filtered signal. To make this a useful spectrum, you will once again want to use fftshift and define an x-axis. Once you have achieved an effective plot of the output frequency spectrum, compare the spectrum with that obtained in part b . and confirm/refute that the passband corresponds to the targeted range of frequencies.
 We are often asked to confirm that a given filter design

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!