This shows you the differences between two versions of the page.
milestone_2_task_2 [2023/01/18 15:13] scott [Anti-Aliasing Filter Design] |
milestone_2_task_2 [2023/01/23 12:11] (current) scott [Anti-Aliasing Filter Design] |
||
---|---|---|---|
Line 16: | Line 16: | ||
===== General Notes ===== | ===== General Notes ===== | ||
- | For the noise analysis, you will use a previously measured time-domain signal of optical noise in a lab room. Like you did in Milestone 1 Task 1, you will analyze a signal that is 500ms (half second) in duration, sampling at a rate of 100 ksamples/s, yielding a total of 50,000 samples. In this case, we simply want an optical noise signal without any player frequency signal on top of it. While you could use one of your 'noise only' signals acquired from last lab, I suggest you use the provided optical noise signal {{:light.zip|light.zip}}, since it is known to have sufficient noise to be detectable in this lab. | + | For the noise analysis, you will use a previously measured time-domain signal of optical noise in a lab room. Like you did in Milestone 1 Task 1, you will analyze a signal that is 500ms (half second) in duration, sampling at a rate of 100 ksamples/s, yielding a total of 50,000 samples. In this case, we simply want an optical noise signal without any player frequency signal on top of it. While you could use one of your 'noise only' signals acquired from last lab, I suggest you use the provided optical noise signal {{:light.zip|}}, since it is known to have sufficient noise to be detectable in this lab. |
===== Specifications ===== | ===== Specifications ===== | ||
Line 31: | Line 31: | ||
==== Optical Noise Sample ==== | ==== Optical Noise Sample ==== | ||
- | * Time-domain signal of optical noise: {{:light.zip|light.zip}} | + | * Time-domain signal of optical noise: {{:light.zip|}} |
* Format: zipped MATLAB file (.mat) for storing workspace variables | * Format: zipped MATLAB file (.mat) for storing workspace variables | ||
* Contains two variables, t and y | * Contains two variables, t and y | ||
Line 87: | Line 87: | ||
The performance of the laser tag system can be improved by reducing the noise that ultimately ends up across the band of frequencies we care about (~1 - 5 kHz). We are not going to be investigating all of the noise sources in our system, but we are going to look into one of the easiest noise sources to reduce: the optical noise produced by the fluorescent lights in our lab room. | The performance of the laser tag system can be improved by reducing the noise that ultimately ends up across the band of frequencies we care about (~1 - 5 kHz). We are not going to be investigating all of the noise sources in our system, but we are going to look into one of the easiest noise sources to reduce: the optical noise produced by the fluorescent lights in our lab room. | ||
- | We measured the signal produced by the fluorescent lights and saved it as a MATLAB file. {{:light.zip|You can download the data here.}} This data is all noise. After unzipping this file you can load it directly into MATLAB. It contains two variables, t and y. (Use the MATLAB load command.) | + | We measured the signal produced by the fluorescent lights and saved it as a MATLAB file ({{:light.zip|}}). This data is all noise. After unzipping this file you can load it directly into MATLAB. It contains two variables, t and y. (Use the MATLAB load command.) |
You should get a plot similar to the following. | You should get a plot similar to the following. | ||
Line 134: | Line 134: | ||
The specifications of the filter are provided at the top of the lab. You will be using the FIR filter design process that you used in ECEN 380 Lab #5 Task #2. For your convenience, here are links to the ECEN 380 Lab #5 and the discrete filter design handout: | The specifications of the filter are provided at the top of the lab. You will be using the FIR filter design process that you used in ECEN 380 Lab #5 Task #2. For your convenience, here are links to the ECEN 380 Lab #5 and the discrete filter design handout: | ||
- | {{:lab_5_fall2016.pdf|ECEN 380 Lab #5}} | + | {{:lab5_fall2018.pdf|ECEN 380 Lab #5}} |
{{:filter_design_notes.pdf|Handout on discrete time filter design.}} | {{:filter_design_notes.pdf|Handout on discrete time filter design.}} | ||
Line 183: | Line 183: | ||
With this in mind, a low pass filter with a corner frequency of 5 kHz that operates on data sampled at 100 kHz would be a **rect** function that goes from -0.05 to 0.05 in cycles/sample. (Can you see why? We want the low-pass filter to go from -5 kHz to 5 kHz, and the data was sampled at Fs = 100 kHz. So, in units of cycles/sample, our rect goes from -5kHz/100kHz = -0.05 to 5kHz/100kHz = 0.05 cycles/sample.) | With this in mind, a low pass filter with a corner frequency of 5 kHz that operates on data sampled at 100 kHz would be a **rect** function that goes from -0.05 to 0.05 in cycles/sample. (Can you see why? We want the low-pass filter to go from -5 kHz to 5 kHz, and the data was sampled at Fs = 100 kHz. So, in units of cycles/sample, our rect goes from -5kHz/100kHz = -0.05 to 5kHz/100kHz = 0.05 cycles/sample.) | ||
- | IMPORTANT: If you are using the FIR filter design code from the Dr. Rice's filter design handout, note that the frequencies are done in units of cycles/sample. Also note that the code given produces a bandpass filter (so you'll need to set your center frequency to 0 for a lowpass filter), and the B parameter in that code is really the full width of the filter, not the half width. If you took ECEN 380 Fall 2016 or later, your code from Lab #5 Task #2 is likely written with frequencies in Hz. | + | IMPORTANT: If you are using the FIR filter design code from the filter design handout, note that the frequencies are done in units of cycles/sample. Also note that the code given produces a bandpass filter (so you'll need to set your center frequency to 0 for a lowpass filter), and the B parameter in that code is really the full width of the filter, not the half width. If you took ECEN 380 Fall 2016 or later, your code from Lab #5 Task #2 is likely written with frequencies in Hz. |
Plot the resulting sinc function for both a long (N = 2001) and short (N = 21) filter length. Your resulting plots should look like the following: | Plot the resulting sinc function for both a long (N = 2001) and short (N = 21) filter length. Your resulting plots should look like the following: | ||
Line 257: | Line 257: | ||
==== Noise Reduction ==== | ==== Noise Reduction ==== | ||
- | Now that you have finished the design of the anti-aliasing filter, your final job is to see how well it reduces the aliased noise. Do the following: | + | Now that you have finished the design of the anti-aliasing filter, your final job is to see how well it reduces the aliased noise. Do the following: |
- | - Load in your optical noise sample (the one that is 500ms long with 50,000 samples) | + | - Load in the optical noise sample ({{:light.zip|}}, which is 500ms long with 50,000 samples) |
- | - Plot the noise spectrum (frequency domain) **without using your FIR filter** (just like you did before) | + | - Plot the noise spectrum (frequency domain) **without using your FIR filter** (like you did before) |
- Down-sample to Fs = 10kHz | - Down-sample to Fs = 10kHz | ||
- Plot the noise from 1kHz to 5 kHz | - Plot the noise from 1kHz to 5 kHz | ||
- | - Plot the noise spectrum (frequency domain) **using your FIR filter before down-sampling** | + | - Plot the noise spectrum (frequency domain) **using your FIR filter** |
- | - Filter the noise signal with your FIR filter | + | - Filter the noise signal with your FIR filter //before down-sampling// |
- Down-sample the signal to Fs = 10kHz | - Down-sample the signal to Fs = 10kHz | ||
- Plot the noise from 1kHz to 5 kHz | - Plot the noise from 1kHz to 5 kHz | ||
Line 323: | Line 323: | ||
The following items need to be shown to the TAs for pass off: | The following items need to be shown to the TAs for pass off: | ||
- MATLAB code portion showing design of FIR low pass anti-aliasing filter | - MATLAB code portion showing design of FIR low pass anti-aliasing filter | ||
- | - List of FIR filter coefficients | + | - List of FIR filter coefficients (with at least 17 significant digits) |
- List of achieved filter specifications | - List of achieved filter specifications | ||
- Frequency response plot of the low pass FIR filter | - Frequency response plot of the low pass FIR filter |