[SOLVED] BIOENG1320 Project 3-Computing the Fourier Transform of a biological signal

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Project-3_-Fourier-Analysis-Filtering-ktv2vo.zip (279.9 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
Rate this product

Computing the Fourier Transform of a biological signal: The Fourier Transform is perhaps the most popular technique for analyzing biological signals. It allows the signals to be visualized in the frequency domain via spectra. From Lecture, the Fourier Transform is given as follows:

𝑋(𝜔)=∫∞ 𝑥(𝑡)𝑒−𝑗𝜔𝑡𝑑𝑡. (1) −∞

In general, the biological signal 𝑥(𝑡) is too complicated to determine its Fourier Transform 𝑋(𝜔) analytically (i.e., by pencil and paper). A computer must therefore be used. However, the Fourier Transform is a continuous function and an infinite integral. As a result, it cannot be determined with a computer! Three modifications are necessary for computer-based solution. First, the integral is approximated using rectangular pulses of width 𝑇 to convert it to a sum as follows:

𝑋(𝜔) ≈ ∑∞ 𝑥(𝑛𝑇 )𝑒−𝑗𝜔𝑇 𝑛𝑇 . (2) 𝑛=−∞ 𝑠 𝑠 𝑠

Then, the signal is assumed to be non-zero within the finite time interval [0, (𝑁 − 1)𝑇 + 𝑇 ] so 𝑠𝑠

𝜔𝑇= 𝑘 𝑠𝑁

𝑛=0 𝑠 𝑠

𝑛=0 𝑠 𝑠 𝑠
𝑁

𝑠

transform the continuous function to a discrete function as follows:

𝑁−1 −𝑗2𝜋𝑘𝑛
𝑋[𝑘] = 𝑋(𝜔)| 2𝜋 = ∑ 𝑥(𝑛 𝑇 )𝑒 𝑁 𝑇 , 𝑘 = 0,1, … , 𝑁 − 1. (4)

Due: 5:00p, April 20, 2022 (via Canvas)

that the infinite sum becomes a finite sum as follows:
𝑋(𝜔) = ∑𝑁−1 𝑥(𝑛 𝑇 )𝑒−𝑗𝜔𝑇 𝑛𝑇 .

(3) Finally, the continuous variable 𝜔𝑇 is sampled at intervals of 2𝜋 over the range of [0,2𝜋] to

𝑠

For convenience, 𝑇 is set to unity to arrive at the “Discrete Fourier Transform (DFT)” as follows: 𝑠

𝑁−1 −𝑗2𝜋𝑘𝑛
𝑋[𝑘] = ∑𝑛=0 𝑥[𝑛]𝑒 𝑁 , 𝑘 = 0,1, … , 𝑁 − 1. (5)

The DFT is a discrete function and a finite sum. As a result, it is amenable to computer-based solution for a given “sampled signal” 𝑥[𝑛].

The Fast Fourier Transform (FFT) is a family of algorithms for efficient computation of the DFT. These algorithms, in particular, are widely used in biological signal processing.

1

The purpose of this problem is to learn how to use the all-important, built-in fft function.

  1. Figure 1 shows a continuous-time signal 𝑥(𝑡). The Fourier Transform of this signal can be

    determined analytically and is 𝑋(𝜔) = 12 (𝑠𝑖𝑛(6𝜔))2 𝑒−𝑗𝜔12 . Plot the magnitude and phase 6𝜔

    spectra over an 𝜔 range of [0, 𝜋] using a fine sampling interval. This exact result will be needed to compare the FFT results to be computed below.

    Figure 1

  2. Take samples of 𝑥(𝑡) at 𝑇 = 1 to define 𝑥[𝑛] as a vector of 25 samples in length using the 𝑠

    triang function. Use the fft function to compute the DFT of this signal for 𝑁 = 256. Plot the DFT magnitude and phase spectra. Note that the x-axis should range over an 𝜔𝑇 of [0,2𝜋].

    How does this result compare to the analytical result? What is the highest frequency shown by the FFT?

  3. Now plot the DFT spectra of the signal for 𝑁 = 16, 32, 128. Compare all FFT plots with the analytical result. For what values of 𝑁 are the DFT samples (mostly) valid? Which values of 𝑁are,forthemostpart,indicativeofthetruespectralcontentofthesignalandwhy? How can 𝑁 be chosen in practice without knowledge of the analytical result?
  4. Use pair 17 in Table 7.1 (Fourier Transform pairs) and properties in Table 7.2 (Fourier Transform properties) to derive 𝑋(𝜔) in question 1. (Hint: see Practice Exam 1!)
  5. Compute the DFT for the clean action potential signal from Project 1. Plot the DFT magnitude and phase spectra. Note that 𝑇 = 1 in the previous questions. This simplification turned out

    to make frequencies for 𝑥(𝑡) and 𝑥[𝑛] the same values! However, in general, 𝑇 is not unity. 𝑠

    For example, 𝑇 = 0.0796 ms for the action potential signal. So, such simplification no longer 𝑠

    holds. From the red font, it can be inferred that the highest frequency shown by the FFT in units of Hz is half the “sampling frequency” (i.e., 1/(2*0.0796)=6.2814 kHz in this case). So, make sure to plot the spectra from 0 kHz to 6.2814 kHz! Do the spectra meet your expectations for the action potential signal?

𝑠

2

𝑠

Designing a filter to remove noise from a biological signal: In Project 1, a filter impulse response was given, which removed the noise in the noisy action potential signal without compromising the information in the clean action potential signal. In practice, filters are not given! The purpose of this problem is to learn how to design a filter.

  1. Plot the DFT magnitude and phase spectra for the noisy action potential signal from Project 1. Compare to the corresponding plots of the clean action potential signal. This comparison may be facilitated using units of decibels. What are the main differences in the frequency- domain? Noting these differences should help in filter design.
  2. Now design a filter using window-based filter design to selectively remove the noise. Use the built-in function fir1. Apply the filter to each signal while experimenting with different cutoff frequencies. Plot the selected filter impulse response and each of the filtered signals. What kind of filter was selected and what were the cutoff frequencies?

    Deliverables: Submit a single pdf file containing answers to the questions, properly labeled plots, and the source code.

3

  • Project-3_-Fourier-Analysis-Filtering-ktv2vo.zip