
Fourier Transform and Nyquist Theorem in C/C++ Programming
Explore the concepts of compiling, linking, and Fourier Transform in C/C++ programming, along with understanding Nyquist Theorem and audio sampling rates. Learn about the file extensions and contents in C++ classes, and identify compile-time and link-time errors. Gain insights into network latency and signals represented as sine waves, and delve into the Sampling Theorem in the context of Nyquist. Dive into practical examples to solidify your understanding of these topics.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
SE3910 Week 6, Class 1 Today C/C++: .h/.cpp; compiling and linking Fourier Transform (corrected) Nyquist Theorem Audio sampling rates SE-2811 1 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder
Ex: C/C++ (Review) Why do we have both .h and .cpp file extensions for C++? Why not just have .cpp (like .java for Java classes)? Answer these questions: 1. What should you put into a class s .h file? 2. What should you put into a class s .cpp file? [Note: On next lab, use .hpp and .cpp instead of .h and .cpp] SE-2811 Dr.Yoder 2
Compiling and Linking Compiling Converting individual .c or .cpp file to object code Linking Combining multiple object (.o) files into an excecutable (usually without extension, or .exe on Windows) SE-2811 Dr.Yoder 3
Ex: C/C++ Circle the link-time errors. Box the compile- time syntax error warning: implicit declaration of function `...' point.m:40: error: mypoint undeclared (first use in this function) parse error before `... collect2: ld returned 1 exit status undefined reference to `filterText' /usr/lib/crt1.o(.text+0x18): undefined reference to `main ' SE-2811 Dr.Yoder 4
Network Latency with resmon.exe SE-2811 Dr.Yoder 5
Signals as sums of sine-waves http://ccn.ucla.edu/BMCweb/SharedCode/s lides/SlideFiles.html http://mathworld.wolfram.com/FourierSerie sSquareWave.html 6 SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling
SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 7
Sampling Theorem (again Nyquist) fs = 2B (B is bandwidth of signal) SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 8
Ex: If this is 1 second, what is the output if we sample 3 times per second? 1 0.8 0.6 0.4 0.2 0 0 60 120 180 240 300 360 420 480 540 600 660 720 780 840 900 960 1020 1080 -0.2 -0.4 -0.6 -0.8 -1 SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 9
Units: dB What is a decibel? A tenth of a bel What is a bel? The log10 of some ratio. X dB = 10 log10 (Y) Ex: How to compute Y from X? X in units of dB Y simple ratio (unitless) e.g. signal power / noise power 10
In-class Activity: Analog to digital bandwidth ????2 (1 +? ?) Suppose you would like to send video in a (relatively) low-frequency with a narrow bandwidth of 1 Mhz The connection is fairly noisy and you can only get 20dB SNR What bit-rate can you achieve? 11 SE-3910 - Dr. Josiah Yoder
Ex: What are two ways we can avoid the stroboscopic effect in a video game simulation of a rotating wheel? SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 12
Muddiest Point Wait for the slides, or follow this link to answer both questions at once: http://bit.ly/1Mow5a3 SE-2811 Dr.Yoder 13
Muddiest Point Wait for the slides, or follow this link to answer both questions at once: http://bit.ly/1Mow5a3 SE-2811 Dr.Yoder 14
http://bit.ly/1Mow5a3 SE-2811 Dr. Josiah Yoder 15
http://bit.ly/1Mow5a3 SE-2811 Dr. Josiah Yoder 16
References EB: Derek Malloy, Exploring Beaglebone, Wiley, 2015 http://www.linuxtopia.org/online_books/an_intro duction_to_gcc/gccintro_95.html http://www.network- theory.co.uk/docs/gccintro/gccintro_95.html http://stackoverflow.com/questions/5645387/gc c-compile-errors-in-an-basic-example-objc- program http://www.linuxtopia.org/online_books/an_intro duction_to_gcc/gccintro_94.html SE-2811 17 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder