91 views

Uploaded by Christopher Cheuvront

University of Arizona ECE 340

save

- Assignment Answers
- Lab 5 Long Repot
- ss1a visualrepresentation
- Spatial Frequency
- Introduction
- Filtering Desingn 1
- Mavic Pro 1080p60
- Sampling Lab5
- hanrahan95
- 27
- 01 Sampling and Reconstruction v4
- 3 MD-Sampling S12 v5 2p
- Dc Assignment
- The Sensitive Side of Android
- Audience
- Fourier Analysis
- LAB S3
- Nihon-Kohden_TEC-9110,9130_ECG_Monitor_-_Service_manual.pdf
- 10.1.1.436.6086
- Basic Numerical data processing for geophysics
- Fourier Series Expansions
- Frequency Domain Filtering (SH Foong)
- drfm_1
- 2700
- wp279
- linearFilters2d.pdf
- PostSi_Vallidation
- 01_intro_2up.pdf
- Application of Wavelet Theory to Digital Audio Signal Processing
- Vibration Adv 0402
- Ece340 MATLAB Soln8 s13
- Ece340 MATLAB Soln9 s13
- Ece340 MATLAB Soln7 s13
- Ece340 MATLAB Soln1 s13
- Ece340 MATLAB Soln6 s13
- Ece340 MATLAB Soln2 s13
- Ece340 MATLAB Soln5 s13
- ECE 340 - Final Exam - Notes
- ece340_soln1_s13

You are on page 1of 7

Spring 2013

% hmwk10.m % % Commands to produce the results for MATLAB Set #10. fs_fast=1000; % Create the original waveform using a fast sampling frequency. Ts_fast=1/fs_fast; % Compute the sampling period (0.001) for this fast sampling rate. t_final=1; % Define the time horizon to be one second long. time=0:Ts_fast:t_final; % Create a one second time interval for the original waveform. xf=sin(15*(2*pi)*time)+sin(40*(2*pi)*time); % Original waveform: 15 Hz and 40 Hz comp. figure(1) plot(time,xf) % Examine the original waveform in the time domain. title('Original Waveform with 10 Hz and 40 Hz Components') Xf=fft(xf); % Compute the FFT (frequency response) for this original waveform. % I have selected the time horizon (1 second) and the sampling frequency (1000 Hz) % to make interpreting the FFT results a little easier. The FFT will provide the frequency % content of our signals. faxis=0:(1/t_final):(1/Ts_fast); % Define the frequency axis for this fast sampling case. figure(2) stem(faxis,abs(Xf)), % Examine the frequency content in the original waveform. title('Frequency Response of the Original Waveform') % What happens if we do not sample fast enough? % What if we only sample at 50 Hz? % To capture the high frequency component we would need to sample faster than 80 Hz! fs_slow=50; % Define a slow sampling frequency of 50 Hz. Ts_slow=(1/fs_slow); % Compute the slow sample period (0.02). time_slow=0:Ts_slow:t_final; % Create a time axis using this longer sample period. xs=sin(15*(2*pi)*time_slow)+sin(40*(2*pi)*time_slow); % Sample waveform slower. figure(3) plot(time_slow,xs), % Does this waveform look at all like the original waveform? title('Original Waveform with a Slow Sampling Frequency') % What happened to the high frequency component? % Did the high frequency component become aliased to a lower frequency? % Does this slow-sampled waveform appear to have another low frequency component? % What if we examine this slow-sampled waveform’s frequency content? faxis_slow=0:(1/t_final):(1/Ts_slow); % Create a new frequency axis based on Ts_slow. Xs=fft(xs); % Compute the FFT (find the frequency content) in this new signal. figure(4) stem(faxis_slow,abs(Xs)), % Is the frequency content consistent with your calculations? title('FFT of the Slowly Sampled Waveform')

% What low frequency components are present in this slow-sampled waveform? % For a sampling rate of 50 Hz, which produces a folding frequency of 25 Hz, does the % frequency content look consistent with your analysis? % Only concentrate on the frequencies below the folding frequency. % % You do not need to complete the rest of this material. % I am providing this material for your entertainment. % % You could examine the data more closely, if you wanted to manually display the % frequency and magnitude of the frequency response together. % % For the fast sampling: [faxis(1:50);abs(Xf(1:50))], % Examine the frequency content for first 49 Hz of original. % % For the slow sampling: [faxis_slow(1:20);abs(Xs(1:20))], % Examine the first 19 Hz of the slowsampled waveform. % % MATLAB has a command that will allow one to reduce the sample-rate without introducing % as much aliasing. The command is called ‘decimate’. The ‘decimate’ command performs a % low-pass filter on the original signal before the sampling is reduced! % Suppose we use the ‘decimate’ command and still reduce the sampling rate. % Let’s reduce the sampling rate by a factor of 20, from 1000 Hz to 50 Hz. % To learn more about the ‘decimate’ command, just type “help decimate” xs2=decimate(xf,20); % Extract every 20th data point in the fast-sampled waveform. time_slow2=decimate(time,20); % Extract the consistent set of time values. figure(5) stem(time_slow2,xs2), % Examine the waveform with anti-aliasing filtering performed. title('Sampled Original Waveform after Passing Through Anti-Aliasing Filter') hold on, % I will compare this with the original low frequency component. plot(time,sin(15*(2*pi)*time)), % Low-frequency component of original. stem(time_slow2,xs,'k'), % Go ahead and examine the aliased waveform. (Black 'k') legend('Anti-Aliased Filtered Original','Low-Frequency Component','Aliased Waveform') % It should be clear that the aliased waveform contains additional frequency content. % Thus, one should pre-filter, with an anti-aliasing filter, prior to sampling a waveform. % If one does not pre-filter, there is the risk that high frequency content will be aliased % down to lower frequencies, which can produce undesired results!

Figure 1 (below):

Original Waveform with 10 Hz and 40 Hz Components 2 1.5 1 0.5 0 -0.5 -1 -1.5 -2

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Figure 2 (below):

Frequency Response of the Original Waveform 600

500

400

300

200

100

0

0

100

200

300

400

500

600

700

800

900

1000

Figure 3 (below):

Original Waveform with a Slow Sampling Frequency 2 1.5 1 0.5 0 -0.5 -1 -1.5 -2

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Figure 4 (below):

FFT of the Slowly Sampled Waveform 25

20

15

10

5

0

0

5

10

15

20

25

30

35

40

45

50

Figure 5 (below):

Sampled Original Waveform after Passing Through Anti-Aliasing Filter 2 1.5 1 0.5 0 -0.5 -1 -1.5 -2 -0.2 Anti-Aliased Filtered Original Low-Frequency Component Aliased Waveform

0

0.2

0.4

0.6

0.8

1

1.2

- Assignment AnswersUploaded bySteffi Cruz
- Lab 5 Long RepotUploaded byCik Zie Jer
- ss1a visualrepresentationUploaded byapi-337162869
- Spatial FrequencyUploaded byNaivedya Jagdish Prasad Mishra
- IntroductionUploaded bydafenshi
- Filtering Desingn 1Uploaded byFebry N Hariyono
- Mavic Pro 1080p60Uploaded byfodendeyo
- Sampling Lab5Uploaded byMengistu Abera
- hanrahan95Uploaded byJanarthanam Subramaniam
- 27Uploaded bysayed Tamir jan
- 01 Sampling and Reconstruction v4Uploaded byAdrià Pons
- 3 MD-Sampling S12 v5 2pUploaded byManish Pawar
- Dc AssignmentUploaded byL R Vinod Vidon
- The Sensitive Side of AndroidUploaded bySteinerOk
- AudienceUploaded bysuryansh
- Fourier AnalysisUploaded byNabila Fauzi
- LAB S3Uploaded byMuhammad Shahroz Afzal
- Nihon-Kohden_TEC-9110,9130_ECG_Monitor_-_Service_manual.pdfUploaded byAnonymous EABpniB
- 10.1.1.436.6086Uploaded byMarcelo Gimenez Magalhães
- Basic Numerical data processing for geophysicsUploaded byHoidi Shitakwa Zacharia
- Fourier Series ExpansionsUploaded bysrk_mce8506
- Frequency Domain Filtering (SH Foong)Uploaded byNguyễn Hưng Idiots
- drfm_1Uploaded bychandra_kanth8161
- 2700Uploaded byJCM
- wp279Uploaded bysantanu_sinha87
- linearFilters2d.pdfUploaded byMara Felipe
- PostSi_VallidationUploaded byGiacomover
- 01_intro_2up.pdfUploaded byelka
- Application of Wavelet Theory to Digital Audio Signal ProcessingUploaded byayhanyks
- Vibration Adv 0402Uploaded bySajid Rafique

- Ece340 MATLAB Soln8 s13Uploaded byChristopher Cheuvront
- Ece340 MATLAB Soln9 s13Uploaded byChristopher Cheuvront
- Ece340 MATLAB Soln7 s13Uploaded byChristopher Cheuvront
- Ece340 MATLAB Soln1 s13Uploaded byChristopher Cheuvront
- Ece340 MATLAB Soln6 s13Uploaded byChristopher Cheuvront
- Ece340 MATLAB Soln2 s13Uploaded byChristopher Cheuvront
- Ece340 MATLAB Soln5 s13Uploaded byChristopher Cheuvront
- ECE 340 - Final Exam - NotesUploaded byChristopher Cheuvront
- ece340_soln1_s13Uploaded byChristopher Cheuvront