Академический Документы
Профессиональный Документы
Культура Документы
Joshua Beckerman
Dr. Glauser
MAE 315 Mechanical and Aerospace Engineering Lab
October 30, 2015
Beckerman
Lab
2
Digital
Signal
Processing
Table of Contents
1. Abstract 3
2. Introduction 4
3. Procedure . 16
4. Results/Discussion 34
5. Conclusion 53
6. Works Cited 54
7. Appendix 55
Page
|
2
Beckerman
Lab
2
Digital
Signal
Processing
1. Abstract
The purpose of this lab is to gain an in-depth understanding of Digital Signal Processing,
its uses, and how to analyze various signals and data input. DSP is an umbrella under which
there are many sub-categories: Filtering, Sources of Error, Methods of Conversation (between
Analog and Digital), and Numerical Analysis. DSP is used in an extensive range of applications,
but most include the need for collecting data in a manner that cannot be otherwise visually
inspected and obtained.
This lab ties together several real-world examples of DSP and sources of error that can be
seen without the need for an oscilloscope. One such example is that of the electric guitar. The
analog signal is generated by the vibration of the springs, which is captured by the pick-ups (a
form of transducer) and sent out of the guitar. It is then up to the equipment to convert this signal
to a digital format so it can be processed down the road. This lab will look into the mechanism
by which all of this occurs in a way that helps to explain many aspects of DSP.
In this lab, we will see a variety of waveforms and sources of error. We will be testing
Sine Waves, Square Waves, and Triangle Waves and the effects that Clipping, Quantization, and
Aliasing have on these waves and the signal output from a program called LabVIEW. Following
the experiment, an in-depth comparative analysis based on the signal output will be crucial to
understanding how waveforms can be affected by various parameters.
By the end of the lab, we will have a greater comprehension of how waveforms can be
filtered for particular desired frequencies and what the effects that has on the waveform. We will
see how simulated waves compare to generated waves. We will also know how to perform a
Fourier Analysis on a given waveform as well as how the reconstruction it yields can help to
interpret a signal.
All of the information within this lab is of great concern to Mechanical and Aerospace
engineers because, without DSP, engineers would only have crude methods for measuring the
phenomena with which they are concerned. In addition to know why DSP is important, the
information on sources of error and anti-aliasing will be crucial for obtaining accurate and
reliable results.
Page
|
3
Beckerman
Lab
2
Digital
Signal
Processing
2. Introduction
The goal of this entire endeavor is to acquire a greater understanding of Digital Signal
Processing (DSP) and its applications within the field of engineering and elsewhere. This
understanding would not be complete without a close look at how digital signals can be analyzed
in a manner that addresses any associated error and uncertainty. In order to interpret much of the
data extracted from these signals, one must also become familiar with Fourier Analysis, a
powerful computational tool that closely approximates any well-behaved function. Each aspect
of the lab just mentioned will be explained in depth within this section such that information
presented in the subsequent sections can be put into context.
The first and most pertinent question to this lab is What is Digital Signal Processing?
Before looking at anything else, an understanding of this subject is absolutely necessary. Signal
Processing is based on the collection of information. When performing any kind of experiment,
the need for accumulating and interpreting data is unavoidable. Whether the measured parameter
varies in discrete increments or continuously is a key, determining factor as to how that data can
be recorded.
would be measuring their ascent as a function of time and, though escalators normally move at a
constant speed, that rate could change at certain points along the interval if the escalator were to
speed up and slow down. Digital signal processing is the collection of information when the
Page
|
4
Beckerman
Lab
2
Digital
Signal
Processing
given data can be measured in discrete increments. Conversely, analog signals are those that vary
continuously and cannot necessarily be broken down into discrete increments or data points.
The difficulty lies within the fluidity of the world in which we live. In our daily lives,
nothing is actually discrete. All things in the macroscopic levels of physics, chemistry, biology,
etc. vary in an infinitely continuous way that makes data points simply a manifestation of the
limitations of the collection method chosen. Considering this lab is concerned primarily with
DSP and not the philosophical interpretations of the world around us, we will leave this
argument simply with the understanding that DSP is always limited by the number of data points
that can be collected. This then begs the question if that recreation of an actual event accurately
represents the event the data came from. (Keep this concept in mind when aliasing is discussed
later in this section.)
For engineers, DSP is a revolution in the field. Before such capabilities existed, engineers
could only rely on full-scale experiments, hand-calculated predictions, and an educated guess-
based system of trial and error. When the engineers at Tesla Motors were developing the Model
S, they understood the power of Digital Signal Processing. The Model S is an electric,
production sedan that has sensors for every aspect of its operation. In fact, because the Model S
is controlled by a powerful onboard computer that communicates with Teslas Roadside
Assistance, most issues can be diagnosed and solved remotely by a Tesla employee in a fraction
of the time. Tesla technicians have access to numerous data sets in order to see exactly when and
Page
|
5
Beckerman
Lab
2
Digital
Signal
Processing
why something failed. Though this is only one scenario, it can be easily extrapolated that the
engineering-based offerings of DSP are only limited by the variety and accuracy of sensors
available for interpreting physical phenomena.
Page
|
6
Figure
2.4:
Les
Paul
Traditional
with
Humbucker
Pickups
Beckerman
Lab
2
Digital
Signal
Processing
integers and are assigned in such a way that they can be read by whatever computer is reading
the digital signal.
We can use the example of the electric guitar to illustrate how an A/D Converter can be
used. Since weve already established that the signal leaving the guitar is an analog signal, this
examination will start at the exit of the guitar chord jack. If, instead of plugging into an
amplifier, a musician wanted to establish a hardwired connection from the guitar to a computer
and record directly into ProTools, Garageband, or another similar software, how what they do it?
The answer is an A/D Converter. There are a number of devices on the market for such an
occasion. What is the advantage of this? one might ask. The answer lies within the power of
digital signals themselves. Digital signals are the building blocks of computer input and can
therefore be manipulated as such. Programs such as Garageband have the incredible ability to
simulate any guitar, amplifier, or acoustic environment that has been programmed into the digital
library. When the program receives the digital signal from the A/D Converter, it plays the signal
through a combination of filters that create distortion, warmth, bite, delay, wah-wah, etc. (all
potentially desirable sounds that could come from a guitar setup).
A/D Converters vary in type, ability, mechanism, and accuracy. For the purposes of this
lab, we will be looking at one with 13 bit variable
resolution and a range of 10 volts. These two parameters
are quite important when using this family of devices.
When talking about bits, we are referring to a function of
the number of intervals available for resolution. In an
effort to repurpose an earlier metaphor, this is equivalent
Now looking back at A/D converters, the number of bits and the voltage range directly
relates back to the resolution by Eqn. 2.1:
Page
|
7
Beckerman
Lab
2
Digital
Signal
Processing
=
2(# !" !"#$!!)
(2.1)
If this A/D Converter is using its maximum resolution and maximum voltage range, the
resolution could be easily found:
5 10
= (!"!!)
2048 2
(2.1)
In the discussion about software like Garageband, there was a brief mention of filtering
the digital signal after it is sent to computer. This is a vague term and requires some parsing. In
Digital Signal Processing, filtering is a method of selecting, rejecting, extracting, and modifying
certain frequencies from a raw input. When it comes to DSP, there are four basic types of filters:
High-Pass Filters, Low-Pass Filters, Band-Pass Filters, and Band-Reject Filters.
Page
|
8
Figure
2.7:
Low-
and
High-Pass
Filter
Wiring
Diagrams
http://tuxgraphics.org/toolbox/circuit-design-rc.gif
Beckerman
Lab
2
Digital
Signal
Processing
The order of this setup is very important because, if it were to instead to be reversed (input
voltage in series with a capacitor and in parallel with a resistor) it would then be a High-Pass
Filter (see Fig. 2.7 for wiring diagrams of Low- and High-Pass Filters).
Figure
2.8:
Effect
of
High-Pass
Filter
(see Fig. 2.9). What is unique about the Band-Pass,
http://www.its.bldrdoc.gov/fs-1037/images/hpfiltec.gif
though, is that it is far more selective about the
frequencies that it picks up. One very common
example is the FM Tuner on a radio. At any given moment, there are radio waves of all
frequencies flying through space, being broadcast from all
over. An FM Tuner is a Band-Pass filter that allows the radio
operator to select a specific frequency to tune into. If it
werent for the Band-Pass Filter, radio would sound like a
jumbled mess because the radio would be attempting to pick
up all available frequencies at once.
http://bis.babylon.com/?rt=GetFile&uri=!!XVQ3V8DTBT&type=0&index=17
Figure
2.10:
Effect
of
Band-Page
Reject
|F
9
ilter
http://www.its.bldrdoc.gov/fs-1037/images/bsfltr4c.gif
Beckerman
Lab
2
Digital
Signal
Processing
Fig. 2.10.
In the Results section, it will become apparent that another advantage of using a filter of
some sort is that it also cleans up some of the plots by eliminating the background information.
Filters not only have the ability to remove targeted parts of a signal, but they can also change the
signal. When considering the signal of an electric guitar, running a signal through a filter can
create distortion (literally meaning a distorted form of the original signal). This distorted tonal
output is considered desirable for musicians like Jimmy Page (of Led Zeppelin) and Jack White
(of The White Stripes), but far less desirable for Howard Shore as he listens to the final recording
of the London Philharmonic Orchestra performing the soundtrack to The Lord of The Rings
(which he composed and produced).
Now that the concept of filtering has become clearer, we can look at another way that
digital signals can be an altered representation of event they are describing: error. Error is a
broad term that describes any number of issues, but we are particularly concerned with the error
in Digital Signal Processing that alters a signal in a way that is generally unintentional or
unwanted.
The first source of error that will be examined is called Quantization Error. Quantization
results as a drop in the resolution of the data due to an insufficient number of bits to accurately
show the changes in data this is equivalent to measuring the weight of an average person in
tons. When we think of this as a change in resolution, it is easy to
understand what is going on here. This source of error can be
thought of as switching from an IMAX viewing experience to the
old, 40lb. Sony that still plays your favorite VHS tapes: the
quality is not nearly as good and you will be getting a much more
abstract representation of what was actually going on in reality.
We will see an example of quantization error in the experiments.
Fig. 2.11 shows the general graphical explanation of what is
happening when quantization error occurs. We can extrapolate
Figure
2.11:
Explanation
of
Quantization
Error
from this that increasing the number of bits will generally
http://www.diracdelta.co.uk/science/source/q/u/quantization%20error/quantization-0 01.gif
decrease the amount of quantization and decreasing the number
Page
|
10
Beckerman
Lab
2
Digital
Signal
Processing
of bits will increase the likelihood of quantization. This is of course a scale that is relative to the
size of the increments being measured and the advantage to increasing the number of bits will
diminish as the minimum signal intervals are accounted for.
The next source of error to be discussed is Clipping. Clipping is a form of error that is
reliant on the maximum range of the A/D converter. This means that if the converter cannot read
data greater than a specific value, it will
automatically interpret that data as the
maximum readable value. This is
difficult concept to grasp so a metaphor
may be of some use here. At every
carnival, fair, or theme park, there is a
game that is incredibly simple yet Figure 2.12: Example of Clipping Error
number of names: High Striker, Strength Tester, and Strongman Game are a few. The game is
fairly basic. Hit the pad with the hammer hard enough to knock the puck into the bell (the pad
and the puck are connected via a lever) and you win a prize. Generally, its very hard to actually
hit the bell because the odds are stacked against you because the lever provides very little
mechanical advantage, which means that we can assume this game is an accurate measure of
strength. Now imagine that, in his prime, Muhammad Ali (one of the greatest heavyweight
boxers of all time) approaches the Strength Tester and hits the bell on his first try. Since
Muhammad Ali input more than the maximum measureable force, we cannot know how hard he
hit the pad. The force with which he hit the pad, in DSP terms, is equivalent to the force
necessary to ring the bell no more, no less (see Fig. 2.12).
example, Gumby (the American clay animation franchise) would not exist without the possibility
of aliasing. Though aliasing has its constructive applications, it is detrimental to data collection
the majority of the time.
In Digital Signal Processing, aliasing occurs when the sample rate, or sample frequency,
is too low to collect the true behavior of the signal. Another example of aliasing is a strobe light.
If you were to turn of all the lights in the room so that it is pitch black and flash a strobe light on
your hand as you move it, you would not be able to see its path. If you were to move your hand
from side-to-side, then in a circle, both at the same frequency as the strobe light, it would look
exactly the same.
The main way that aliasing can be avoided is by increasing the sampling rate of the data
collection method. A general rule of thumb is that the greatest frequency that can be resolved
accurately by DSP is a frequency that is equivalent to half of the sampling rate:
=
2
(2.2)
understanding how an aliased signal can be Figure 2.14: Example of DSP Aliasing
https://svi.nl/wikiimg/Aliasing-plot.png
Page | 12
be represented by an infinite sum of sine and cosine waves. Based on this statement, there is a
method of analysis specifically designed for such purposes. This numerical method is called
Fourier Analysis.
Fourier Analysis is used to reconstruct harmonic signals so that computers can interpret
them. The reason for performing such an analysis is not always so clear. It is important to
understand that, though a string of data points can be useful in some situations, a governing
function that applies to an entire subset of data is far more versatile and (for its uses in most DSP
applications) a function is the only way extract and interpret the desired information.
http://mathworld.wolfram.com/FourierSeries.html (2.3)
Where a0, an, and bn are coefficients that are unique to the waveform of the digital signal being
inputted. For our uses in this lab, we will be using the Sine, Square, and Triangle Waves. Table
2.1 below provides the Fourier coefficients necessary. The derivation of the coefficients for the
Triangle Wave has been added to Appendix C.
A 0 A n B n
Sine Wave
0
0
a
Square Wave
0
0
()
Triangle Wave
0
0
()
Table 2.1: Analytical Results for Coefficients of Fourier Series of Each Waveform.
The importance of the Eqn. 2.3 is that this equation is a transformation from one
domain to another. The domain of a function is a set of all possible values for the independent
variable. The original domain a digital signal is the time domain, but the Fourier Transform then
takes that signal and breaks it up into a set of frequencies within the frequency domain.
The concept of multiple domains is very abstract and is best understood by looking at Fig. 2.16:
Page
|
13
Beckerman
Lab
2
Digital
Signal
Processing
Page
|
14
Beckerman
Lab
2
Digital
Signal
Processing
The final measure of this report, which must be discussed, is the concept of uncertainty.
Uncertainty is the quantifiable error inherent in the devices and methods used to measure and
calculate result data. In this lab, uncertainty will be determined using a method known as the
Zeroth Order of Uncertainty. This method is crucial for understanding the accuracy of the
experiment and for those reviewing the results to assess the overall scope of the claims that can
be made when analyzing those results. Zeroth Order of Uncertainty is found using the following
equation:
!"
!,! = ( !,!! )!
!!!
(2.4)
We will see how Zeroith Order of Uncertainty plays a role is found specifically for the
parameters with which we are concerned in the Results section.
Page
|
15
Beckerman
Lab
2
Digital
Signal
Processing
3. Procedure
3.1 Overview
The focus of this experiment is twofold, Digital Signal Processing (DSP) and
Fourier Analysis. In order to gain a thorough understanding of both topics, you will be using
simulated and generated waveforms (sine, square, and triangle waves) to draw comparisons
between raw data and theory. You will also see white noise, which is a non-harmonic function. A
computer program called LabVIEW will create the simulated waves and a B&K Function
Generator will create the generated signals seen in this lab.
Throughout the lab, there will be sources of error associated with the digitization of data
that must be acknowledged and explained. You will also look at how to minimize those errors
using filters (e.g. analog low-pass filter). The sources of error addressed in this lab are clipping,
quantization, and aliasing. All of these data sets and comparisons will be presented in the
Results section along with the relative uncertainty of each technique.
Page
|
16
Beckerman
Lab
2
Digital
Signal
Processing
Page
|
17
Beckerman
Lab
2
Digital
Signal
Processing
In this section, you will not be using any equipment for measurement or generation (e.g.
oscilloscope or A/D converter). Instead, use the LabVIEW simulation to digitally generate
signals within the confines of the program. Remember, it is important to save the data files (both
graphs) for each wave and individual experiment.
1. Make sure that the Write to file command is set to Yes and that the file that will be
written is appropriately named before continuing to the next step.
2. Put the information from Table 3.1 into the LabVIEW Simulator
Input Function
Frequency 600 Hz
Acquisition Control
Resolution 12 bit
Table
3.1:
Inputs
for
Simulation
1
into
LabVIEW
3. Press the Run Arrow at the top of the LabVIEW toolbar.
4. Measure the difference in time, t2 t1, of the Sine Wave on the top plot using the cursor
(peak to peak). Use this to find the period, T, and then calculate the frequency, f.
Page
|
18
Beckerman
Lab
2
Digital
Signal
Processing
1 1
= =
! !
5. On the bottom plot, use the cursor to get a value for the frequency at each reasonably
significant peak in the Fourier Space.
In this section, you will be using two other waveforms, the triangle wave and the square
wave. These will each have plots in the frequency and time domains.
1. Make sure that the Write to file command is set to Yes and that the file that will be
written is appropriately named before continuing to the next step.
2. Put the information from Table 3.2 into the LabVIEW Simulator
Input Function
Frequency 600 Hz
Acquisition Control
Resolution 12 bit
Low-Pass Filtering ON
Page
|
19
Beckerman
Lab
2
Digital
Signal
Processing
4. Measure the difference in time, t2 t1, of the Square Wave on the top plot using the
cursor (peak to peak). Use this to find the period, T, and then calculate the frequency, f.
1 1
= =
! !
5. On the bottom plot, use the cursor to get a value for the frequency at each reasonably
significant peak in the Fourier Space.
1. Make sure that the Write to file command is set to Yes and that the file that will be
written is appropriately named before continuing to the next step.
2. Put the information from Table 3.3 into the LabVIEW Simulator
Input Function
Frequency 600 Hz
Acquisition Control
Resolution 12 bit
Table
3.3:
Inputs
for
Simulation
3
into
LabVIEW
3. Press the Run Arrow at the top of the LabVIEW toolbar.
4. Measure the difference in time, t2 t1, of the Square Wave on the top plot using the
cursor (peak to peak). Use this to find the period, T, and then calculate the frequency, f.
Page
|
20
Beckerman
Lab
2
Digital
Signal
Processing
1 1
= =
! !
5. On the bottom plot, use the cursor to get a value for the frequency at each reasonably
significant peak in the Fourier Space.
1. Make sure that the Write to file command is set to Yes and that the file that will be
written is appropriately named before continuing to the next step.
2. Put the information from Table 3.4 into the LabVIEW Simulator
Input Function
Frequency 600 Hz
Acquisition Control
Resolution 12 bit
Low-Pass Filtering ON
Page
|
21
Beckerman
Lab
2
Digital
Signal
Processing
1 1
= =
! !
5. On the bottom plot, use the cursor to get a value for the frequency at each reasonably
significant peak in the Fourier Space.
1. Make sure that the Write to file command is set to Yes and that the file that will be
written is appropriately named before continuing to the next step.
2. Put the information from Table 3.5 into the LabVIEW Simulator
Input Function
Frequency 600 Hz
Acquisition Control
Resolution 12 bit
1 1
= =
! !
Page
|
22
Beckerman
Lab
2
Digital
Signal
Processing
5. On the bottom plot, use the cursor to get a value for the frequency at each reasonably
significant peak in the Fourier Space.
1. Make sure that the Write to file command is set to Yes and that the file that will be
written is appropriately named before continuing to the next step.
2. Put the information from Table 3.6 into the LabVIEW Simulator
Input Function
Frequency 600 Hz
Acquisition Control
Resolution 12 bit
Low-Pass Filtering ON
1 1
= =
! !
Page
|
23
Beckerman
Lab
2
Digital
Signal
Processing
5. On the bottom plot, use the cursor to get a value for the frequency at each reasonably
significant peak in the Fourier Space.
1. Make sure that the Write to file command is set to Yes and that the file that will be
written is appropriately named before continuing to the next step.
2. Put the information from Table 3.7 into the LabVIEW Simulator
Input Function
Frequency 600 Hz
Acquisition Control
Resolution 4 bit
Low-Pass Filtering ON
1 1
= =
! !
5. On the bottom plot, use the cursor to get a value for the frequency at each reasonably
Page
|
24
Beckerman
Lab
2
Digital
Signal
Processing
1. Make sure that the Write to file command is set to Yes and that the file that will be
written is appropriately named before continuing to the next step.
2. Put the information from Table 3.8 into the LabVIEW Simulator
Input Function
Frequency 600 Hz
Acquisition Control
Resolution 4 bit
Low-Pass Filtering ON
1 1
= =
! !
5. On the bottom plot, use the cursor to get a value for the frequency at each reasonably
significant peak in the Fourier Space.
Page
|
25
Beckerman
Lab
2
Digital
Signal
Processing
1. Make sure that the Write to file command is set to Yes and that the file that will be
written is appropriately named before continuing to the next step.
2. Put the information from Table 3.9 into the LabVIEW Simulator
Input Function
Frequency 600 Hz
Acquisition Control
Resolution 12 bit
1 1
= =
! !
5. On the bottom plot, use the cursor to get a value for the frequency at each reasonably
significant peak in the Fourier Space.
Page
|
26
Beckerman
Lab
2
Digital
Signal
Processing
1. Make sure that the Write to file command is set to Yes and that the file that will be
written is appropriately named before continuing to the next step.
2. Put the information from Table 3.10 into the LabVIEW Simulator
Input Function
Frequency 600 Hz
Acquisition Control
Resolution 12 bit
Table
3.10:
Inputs
for
Simulation
10
into
LabVIEW
3. Press the Run Arrow at the top of the LabVIEW toolbar.
4. Measure the difference in time, t2 t1, of the Sine Wave on the top plot using the cursor
(peak to peak). Use this to find the period, T, and then calculate the frequency, f.
1 1
= =
! !
5. On the bottom plot, use the cursor to get a value for the frequency at each reasonably
significant peak in the Fourier Space.
Page
|
27
Beckerman
Lab
2
Digital
Signal
Processing
In this section, you will be doing the experiments with equipment that will generate real
waves and measure those waves, using the computer to acquire and analyze actual signals via an
A/D converter.
1. Make sure that the Write to file command is set to Yes and that the file that will be
written is appropriately named before continuing to the next step.
2. Put the information from Table 3.11 into the Function Generator and LabVIEW VI.
Function Generator
Frequency 600 Hz
Acquisition Control
Resolution 12 bit
Table
3.11:
Inputs
for
Experiment
11
into
Function
Generator
and
LabVIEW
VI
3. Press the Run Arrow at the top of the LabVIEW toolbar.
4. Measure the difference in time, t2 t1, of the Sine Wave on the top plot using the cursor
(peak to peak). Use this to find the period, T, and then calculate the frequency, f.
Page
|
28
Beckerman
Lab
2
Digital
Signal
Processing
1 1
= =
! !
5. On the bottom plot, use the cursor to get a value for the frequency at each reasonably
significant peak in the Fourier Space.
1. Make sure that the Write to file command is set to Yes and that the file that will be
written is appropriately named before continuing to the next step.
2. Put the information from Table 3.12 into the Function Generator and LabVIEW VI.
Function Generator
Frequency 600 Hz
Acquisition Control
Resolution 12 bit
Table
3.12:
Inputs
for
Experiment
12
into
Function
Generator
and
LabVIEW
VI
3. Press the Run Arrow at the top of the LabVIEW toolbar.
4. Measure the difference in time, t2 t1, of the Sine Wave on the top plot using the cursor
(peak to peak). Use this to find the period, T, and then calculate the frequency, f.
Page
|
29
Beckerman
Lab
2
Digital
Signal
Processing
1 1
= =
! !
5. On the bottom plot, use the cursor to get a value for the frequency at each reasonably
significant peak in the Fourier Space.
1. Make sure that the Write to file command is set to Yes and that the file that will be
written is appropriately named before continuing to the next step.
2. Put the information from Table 3.13 into the Function Generator and LabVIEW VI.
Function Generator
Frequency 600 Hz
Acquisition Control
Resolution 12 bit
Page
|
30
Beckerman
Lab
2
Digital
Signal
Processing
1 1
= =
! !
5. On the bottom plot, use the cursor to get a value for the frequency at each reasonably
significant peak in the Fourier Space.
In this section, you will be exploring the applications of Fourier Analysis using Square
and Triangle Waves in both the time and frequency domains.
1. Make sure that the Write to file command is set to Yes and that the file that will be
written is appropriately named before continuing to the next step.
2. Put the information from Table 3.14 into the Function Generator and LabVIEW VI.
Function Generator
Frequency 600 Hz
Acquisition Control
Resolution 12 bit
Page
|
31
Beckerman
Lab
2
Digital
Signal
Processing
cursor (peak to peak). Use this to find the period, T, and then calculate the frequency, f.
1 1
= =
! !
5. On the bottom plot, use the cursor to get a value for the frequency at each reasonably
significant peak in the Fourier Space.
1. Make sure that the Write to file command is set to Yes and that the file that will be
written is appropriately named before continuing to the next step.
2. Put the information from Table 3.15 into the Function Generator and LabVIEW VI.
Function Generator
Frequency 600 Hz
Acquisition Control
Resolution 12 bit
Table
3.15:
Inputs
for
Experiment
15
into
Function
Generator
and
LabVIEW
VI
3. Press the Run Arrow at the top of the LabVIEW toolbar.
4. Measure the difference in time, t2 t1, of the Triangle Wave on the top plot using the
cursor (peak to peak). Use this to find the period, T, and then calculate the frequency, f.
Page
|
32
Beckerman
Lab
2
Digital
Signal
Processing
1 1
= =
! !
On the bottom plot, use the cursor to get a value for the frequency at each reasonably significant
peak in the Fourier Space.
1. Make sure that the Write to file command is set to Yes and that the file that will be
written is appropriately named before continuing to the next step.
2. Put the information from Table 3.16 into the B&K function generator and LabVIEW VI.
Frequency All
Acquisition Control
Resolution 12 bit
Low-Pass Filter ON
Page
|
33
Beckerman
Lab
2
Digital
Signal
Processing
4. Results/Discussion
In this section, the LabVIEW output from each experimental run in the procedure will be
presented within the context of what it was meant to show (e.g. aliasing, clipping, filtering, etc.).
This output will also have an accompanying description and at least one plot to explain what is
occurring in during that event.
Page
|
34
Beckerman
Lab
2
Digital
Signal
Processing
Any given Fourier reconstruction is made up of a combination of sines and cosines that
approximate a given function. When that function is simply a Sine Wave, it can be approximated
using a Sine Wave (see Fig. A1).
In the time
domain, we can see a
green, Sine Wave
reconstruction. We
cannot see the blue
wave that is under the
reconstruction
because the Fourier
plot is a perfect patch.
The blue wave that is
Table 4.1a: Simulation 1 Results, Time Domain Table 4.1b: Simulation 1 Results, Frequency Domain
Page
|
35
As discussed earlier, an ideal Fourier plot in the frequency domain would show a vertical
line instead of a peak. The reconstruction is an idealized version of the actual data and the point
on this graph above the peak represents where that vertical line would extend. The differences
between actual and reconstructions in the frequency domain plot can be explained by the
associated uncertainty values. Those values and their uncertainties are shown below in Table
4.1c.
Fourier Reconstruction
a 5.13V 4.9E-3V
n*f0 598.1Hz 1.9Hz
Bn 5.13V 4.9E-3V
Table
4.1c:
Uncertainties
in
Frequency
Domain
with
Respect
to
Sine
Wave
Fourier
Reconstruction
These graphical conventions follow for any other reconstructions in the frequency
domain performed in this lab.
For the Square Wave, it is clear that this waveform cannot be reconstructed with either
one sine or one cosine function (see Fig. A3). Instead, there will be a series of waves that make
up a reconstruction. In the time domain, we can see the original blue Square Wave, which are the
actual data points
from Simulation 3.
We can also see
several reconstructed
waves that approach
the shape of the
square wave as the n
value increases. We
can then look to the
frequency domain to
see several peaks (one
Beckerman
Lab
2
Digital
Signal
Processing
These additional peaks represent each of the terms present in the Fourier transform function in
this domain, thus proving the statement above. Aside from the fact that this simulation is not
perfectly ideal, there are no other notable sources of error. The results of Simulation 3 are shown
in Table 4.3a and Table 4.3b.
Table 4.3a: Simulation 3 Results, Time Domain Table 4.3b: Simulation 3 Results, Frequency Domain
As discussed earlier, an ideal Fourier plot in the frequency domain would show a vertical
line instead of a peak. The reconstruction is an idealized version of the actual data and the points
on this graph above the peaks represent where those vertical lines would extend. The differences
between actual and reconstructions in the frequency domain plot can be explained by the
associated uncertainty values. Those values and their uncertainties are shown below in Table
4.3c.
Fourier
n=1 n=3 n=5
Reconstruction
a 6.534V 4.9E-3V 2.508V 4.9E-3V 1.006V 4.9E-3V
n*f0 598.1Hz 1.9Hz 1801Hz 1.0Hz 3003Hz 3Hz
Bn 8.319V 14.5V 1.064V 0.85V 0.256V 0.917V
Table
4.3c:
Uncertainties
in
Frequency
Domain
with
Respect
to
Square
Wave
Fourier
Reconstruction
Page
|
37
Beckerman
Lab
2
Digital
Signal
Processing
Since the Triangle Wave is fairly close to sine and cosine functions, this waveform will
be reconstructed very closely with only a few sine functions (see Fig. A5). In the time domain,
we can see the original blue Triangle Wave, which are the actual data points from Simulation 5.
We can also see
several reconstructed
waves that approach
the shape of the
triangle wave as the n
value increases. We
can then look to the
frequency domain to
see several peaks (one
at ~600Hz, ~1800Hz,
~3000 Hz, and so on).
Table 4.5a: Simulation 5 Results, Time Domain Table 4.5b: Simulation 5 Results, Frequency Domain
As discussed earlier, an ideal Fourier plot in the frequency domain would show a vertical
line instead of a peak. The reconstruction is an idealized version of the actual data and the points
Page
|
38
Beckerman
Lab
2
Digital
Signal
Processing
on this graph above the peaks represent where those vertical lines would extend. The differences
between actual and reconstructions in the frequency domain plot can be explained by the
associated uncertainty values. Those values and their uncertainties are shown below in Table
4.5c.
Fourier
n=1 n=3 n=5
Reconstruction
a 4.158V 4.9E-3V 2.508V 4.9E-3V 1.006V 4.9E-3V
n*f0 598.1Hz 1.9Hz 1801Hz 1.0Hz 3003Hz 3Hz
Bn 3.370V 14.5V .0958V 0.85V .0326V 0.917V
Table
4.5c:
Uncertainties
in
Frequency
Domain
with
Respect
to
Triangle
Wave
Fourier
Reconstruction
4.3 Filtering
In Simulation 2, we saw a Square Wave with a Low-Pass Filter (see Figure A2).
With the low-pass filter, there are obvious changes in the appearance of both the time and
frequency domains.
Looking at in the
time domain, it can
be seen that the
shape of the Square
Wave is now
somewhat off.
Specifically, the
sharp corners have
now become
rounded and even
amplitude of the
original wave. In the frequency domain, we see that the peaks disappear after the cutoff
frequency, 10kHz. In addition, the other minor spikes in between the important peaks have been
Page
|
39
Beckerman
Lab
2
Digital
Signal
Processing
filtered out. The results of Simulation 2 are shown in Table 4.2a and Table 4.2b.
Table 4.2a: Simulation 2 Results, Time Domain Table 4.2b: Simulation 2 Results, Frequency Domain
In Simulation 4, we saw a Triangle Wave with a Low-Pass Filter (see Figure A4). With
the low-pass filter, there are slight changes in the appearance of the time domain. By contrast,
the frequency domain looks very similar to that of the unfiltered (with exception of the peaks
disappearing after the cutoff frequency). Looking at in the time domain, it can be seen that the
shape of the Triangle Wave is now somewhat rounded on the tops. The results of Simulation 4
are shown in Table 4.4a and Table 4.4b below.
Page
|
40
Time Domain Frequency Domain
Table 4.4a: Simulation 4 Results, Time Domain Table 4.4b: Simulation 4 Results, Frequency Domain
In Simulation 6, we reproduced the same Sine Wave as in Simulation 1. This run is meant
to act as a baseline test for us to be able to make comparisons to the next experiments results.
Because this is a simulation and the inputs were identical, no description is needed. In any case,
the plot of Simulation 6 is provided in Fig. A6 below for completeness.
The results from Simulation 6 have also been given in Table 4.6a and Table 4.6b. You
will notice that they are similar results to Simulation 1. The only differences are the points
chosen for sampling.
Time Domain Frequency Domain
Table 4.6a: Simulation 6 Results, Time Domain Table 4.6b: Simulation 6 Results, Frequency Domain
As mentioned, these results do not contain any sources of significant error, but will be a
good control group for comparison.
In Simulation 7, this is the first exposure to quantization error. We can see in Fig. A7 that
this plot does not look like a normal Sine Wave, as in Simulation 6. Instead, we see a very
interesting shape that resembles a piecewise function that is imitating the harmonic behavior of a
Sine Wave. It is important to keep in mind that the only parameter changed between Simulation
6 and Simulation 7 was the number of bits (the resolution of the A/D converter). This means that
the uncertainty in voltage measurement will be greater.
Time Domain Frequency Domain
Table 4.7a: Simulation 7 Results, Time Domain Table 4.7b: Simulation 7 Results, Frequency Domain
In Simulation 8, we see quantization error again, but this time on a Square Wave. We can
see in Fig. A8 that this plot does not look like a normal Square Wave, especially when compared
to Simulation 3. Instead, we see a very interesting shape that resembles a piecewise function that
is imitating the
harmonic behavior of
a Square Wave. Just
as in Simulation 7, it
is important to
remember that the
only parameter
changed in Simulation
8 was the number of
bits (the resolution of
the A/D converter).
uncertainty in voltage measurement will be greater. Something new to note in this graph is that
there is a unique oscillation about its amplitude at 6.0V. This is interesting because, in a standard
Square Wave, this part of the wave should be flat.
Time Domain Frequency Domain
Table 4.8a: Simulation 8 Results, Time Domain Table 4.8b: Simulation 8 Results, Frequency Domain
Much like in Simulation 6, Simulation 9 is meant for a basis of comparison for the
following experiment in order to draw conclusions about what exactly happens to a Sine Wave
during clipping. This being said, the plot of Simulation 9 is provided in Fig. A9 below for
completeness.
The results from Simulation 9 have also been given in Table 4.9a and Table 4.9b. You
will notice that they are similar results to Simulations 1 and 6. The only differences are the points
chosen for sampling.
Time Domain Frequency Domain
Table 4.9a: Simulation 9 Results, Time Domain Table 4.9b: Simulation 9 Results, Frequency Domain
As mentioned, these results do not contain any sources of significant error, but will be a
good control group for comparison.
In Simulation 10, this is the first exposure to clipping. We can see in Fig. A10 that this
plot does not look like a normal Sine Wave, as in Simulation 9. Instead, we see a very interesting
shape that looks more a Square Wave with rounded edges. It is important to keep in mind that
the only parameter changed between Simulation 9 and Simulation 10 was the bipolar voltage
range. This means that any data that exceeds 1.0V will be literally clipped off the top of the
wave.
Time Domain Frequency Domain
Table 410.a: Simulation 10 Results, Time Domain Table 4.10b: Simulation 10 Results, Frequency Domain
Just as in each of the other two sections on sources of error, we will first create a baseline
plot against which we can compare the following experiment. Due to the nature of aliasing, we
will need to cease our simulations and begin the experimental procedures so that we can see this
error source. Experiment 11 is meant for a basis of comparison for the following experiment in
order to draw conclusions about what exactly happens to a Sine Wave during clipping. This
being said, the plot of Experiment 11 is provided in Fig. A11 below for completeness.
Beckerman
Lab
2
Digital
Signal
Processing
The results from Experiment 11 have also been given in Table 4.11a and Table 4.11b.
You will notice that they are similar results to Simulations 1, 6, and 9. The only differences are
the points chosen for sampling.
Table 4.11a: Experiment 11 Results, Time Domain Table 4.11b: Experiment 11 Results, Frequency Domain
As mentioned, these results do not contain any sources of significant error, but will be a
good control group for comparison.
In Experiment 12, this is the first exposure to aliasing. We can see in Fig. A12 that this
plot does not resemble the Sine Waves weve seen up until now very much (if at all). Instead, we
see a very jagged
harmonic function
that looks alters its
offset as time goes on.
It is important to keep
in mind that the only
parameter changed
between Experiment
11 and 12 was the
sampling frequency.
much harder to visualize than other kinds of errors. For this reason, there are Nyquist Aliasing
Page
|
47
Beckerman
Lab
2
Digital
Signal
Processing
Due to this aliasing, the results of the experiment will not resemble those of any Sine
Wave seen thus far (see Table 4.12a and Table 4.12b).
Table 4.12a: Experiment 12 Results, Time Domain Table 4.12b: Experiment 12 Results, Frequency Domain
We can see that these results match the skewed data from the plot above.
Page
|
48
Beckerman
Lab
2
Digital
Signal
Processing
In Experiment 13, we see aliasing again. We can see in Fig. A13 that this plot does not
resemble the Sine Waves weve seen up until now very much (if at all). Instead, we see a very
jagged harmonic
function. It is
important to keep in
mind that the only
parameter changed in
Experiment 13 is that
the Sine Wave is
being run through a
Krohn-Hite Filter,
which is of higher
Page
|
49
Time Domain Frequency Domain
Table 4.13a: Experiment 13 Results, Time Domain Table 4.13b: Experiment 13 Results, Frequency Domain
We can see that these results match the skewed data from the plot above.
In Experiments 14 and 15, we are collecting data on a basic Square Wave without a filter
and a basic Triangle Wave without a filter, respectively. There are no new aspects to these data
sets, but instead they are collected so that they can be looked at in comparison to the simulated
Square Wave and simulated Triangle Wave. These data sets will be shown below, but there will
be no in-depth descriptions here due to the lack of contrasting information.
Beckerman
Lab
2
Digital
Signal
Processing
The results from Experiment 14 have also been given in Table 4.14a and Table 4.14b.
Table 4.14a: Experiment 14 Results, Time Domain Table 4.14b: Experiment 14 Results, Frequency Domain
The results from Experiment 15 have also been given in Table 4.15a and Table 4.15b.
Page
|
51
Time Domain Frequency Domain
Table 4.15a: Experiment 15 Results, Time Domain Table 4.15b: Experiment 15 Results, Frequency Domain
In the final run, Experiment 16, we look at White Noise. White Noise is a non-harmonic
function. The randomness of this signal can be seen at first glance in Figure A16. Due to the
nature of this function, there is very little information that we can take away from it. No data was
directly collected during the lab session due to time constraints, as well as the nature of the signal
itself.
Beckerman
Lab
2
Digital
Signal
Processing
5. Conclusion
As weve seen throughout this lab, there are a number of factors that are extremely
important when it comes to Digital Signal Processing and obtaining useful data in any type of
application. Harmonic waves are prevalent in many fields of study and without methods like
Fourier Analysis, there would be no way to properly examine and analyze them. Some of the
most notable results from this experiment can be found in the uncertainties in key parameters. In
other words, the accuracy of a processed signal is extremely dependent upon the proper choice of
bipolar range, sampling frequency, and number of bits. Improper selection of measurement
parameters can lead to large errors in aliasing, quantization, and clipping all of which can be
highly detrimental to obtaining reliable results.
In engineering, it is important to begin any type of analysis with the existing conditions,
parameters, governing laws, and constraints. Without such knowledge, a complete understanding
of the task at hand would be impossible. For this to be possible, there must be data and
explanations for any phenomena that occur within the system of interest. With Digital Signal
Processing, it is possible to obtain an unmatched level of sophistication within an engineering
analysis. Once the system is properly understood, then a solution is designed. Before a job is
completed, the new solution must be tested to confirm that in practice it performs as it was
designed. This is another instance within the basic design process that DSP presents itself.
It is apparent that the basic procedure of any engineering task, if done correctly, is
heavily reliant on accurate data acquisition and digital signal processing. For instance,
redesigning a cars suspension first requires an understanding of how the original suspension
performs and what the pitfalls are of that design. Then, an engineer might develop a new design
based on theoretical knowledge, prototypes, and computer modeling software. Before the new
car is sent out for mass production or to the racetrack, extensive testing is required once again in
order to confirm the calculations and assumptions made during the design process. This timeline
would not be possible with force transducers on the pushrods, shockpots on the dampers, strain
gauges on the chassis, and A/D converters to take all of this data and organize it in a way that
will improve the design process overall as well as the quality of the design produced by an
engineer.
Page
|
53
Beckerman
Lab
2
Digital
Signal
Processing
6. Works Cited
"(56) Signals and Systems in the Frequency Domain Fourier Series." MAE 315 - Mechanical and
Aerospace Engineering Laboratory Fall 2015. Ed. John-Michael Velarde. Syracuse
University Engineering and Computer Science, n.d. Web. 25 Oct. 2015.
<http://ecs.syr.edu/faculty/glauser/mae315/notesNrefs/Fourier/fourierpg.html>.
Brain, Marshall. "How Electric Guitars Work." How Stuff Works: Entertainment. How Stuff
Works, n.d. Web. 25 Oct. 2015. <http://entertainment.howstuffworks.com/electric-
guitar1.htm>.
Formosa, Dan. "How Tube Amps Work." Premier Guitar RSS. EPublishing, n.d. Web. 25 Oct.
2015. <http://www.premierguitar.com/articles/17116-how-tube-amps-
work?page=1%5C>.
"Roadside Assistance & Tech Support." Tesla: Support. Tesla Motors, n.d. Web. 25 Oct. 2015.
<http://www.teslamotors.com/support/roadside-assistance-tech-support>.
Rouse, Margaret. "What Is Analog-to-digital Conversion (ADC)? - Definition from
WhatIs.com." WhatIs.com. TechTarget, n.d. Web. 25 Oct. 2015.
<http://whatis.techtarget.com/definition/analog-to-digital-conversion-ADC>.
Rouse, Margaret. "What Is Transducer? - Definition from WhatIs.com." WhatIs.com.
TechTarget, n.d. Web. 25 Oct. 2015.
<http://whatis.techtarget.com/definition/transducer>.
"Use of Computer for Data Acquisition and Processing." MAE 315 - Mechanical and Aerospace
Engineering Laboratory Fall 2015. Ed. John-Michael Velarde. Syracuse University
Engineering and Computer Science, n.d. Web. 25 Oct. 2015.
<http://ecs.syr.edu/faculty/glauser/mae315/notesNrefs/compdata/Daq.html>.
Wallace, Hank. "How Do Guitar Pickups Work?" Atlantic Quality Design, Inc., How Do Guitar
Pickups Work? N.p., n.d. Web. 25 Oct. 2015. <http://www.aqdi.com/pickups.htm>.
Weisstein, Eric W. "Fourier Series." Wolfram MathWorld. Wolfram Alpha, n.d. Web. 25 Oct.
2015. <http://mathworld.wolfram.com/FourierSeries.html>.
Page
|
54
Beckerman
Lab
2
Digital
Signal
Processing
Appendices
Page
|
55
Beckerman
Lab
2
Digital
Signal
Processing
Figure A1: Simulation 1, Basic Sine Wave (with Fourier reconstruction graph overlaid).
Figure A2: Simulation 2, Sine Wave, Filter On.
Page
|
A1
Beckerman
Lab
2
Digital
Signal
Processing
Figure A3: Simulation 3, Square Wave, Filter Off (with Fourier reconstruction graph overlaid).
Figure A4: Simulation 4, Triangle Wave, Filter On.
Page
|
A2
Beckerman
Lab
2
Digital
Signal
Processing
Figure A5: Simulation 5, Triangle Wave, Filter On (with Fourier reconstruction graph overlaid).
Figure A6: Simulation 6, Quantization Error and Resolution, Control (Sine Wave).
Page
|
A3
Beckerman
Lab
2
Digital
Signal
Processing
Figure A7: Simulation 7, Quantization Error and Resolution, Changed (Sine Wave).
Figure A8: Simulation 8, Quantization Error and Resolution, Changed (Square Wave).
Page
|
A4
Beckerman
Lab
2
Digital
Signal
Processing
Figure A10: Simulation 10, Clipping, Changed (Sine Wave).
Page
|
A5
Beckerman
Lab
2
Digital
Signal
Processing
Figure A12: Experiment 12, Anti-Aliasing and Filtering (Sine Wave).
Page
|
A6
Beckerman
Lab
2
Digital
Signal
Processing
Figure A13: Experiment 13, Anti-Aliasing and Filtering, Krohn-Hite Filter (Sine Wave).
Figure A14: Experiment 14, Fourier Analysis Experiment (Square Wave).
Page
|
A7
Beckerman
Lab
2
Digital
Signal
Processing
Figure A16: Experiment 16, Fourier Analysis Experiment (White Noise).
Page
|
A8
Beckerman
Lab
2
Digital
Signal
Processing
Page
|
A9
Beckerman
Lab
2
Digital
Signal
Processing
Page
|
A10
Beckerman
Lab
2
Digital
Signal
Processing
Page
|
A11
Beckerman
Lab
2
Digital
Signal
Processing
Page
|
A12
Beckerman
Lab
2
Digital
Signal
Processing
! !!
!!
1 ! !
! = ! + ! + !
!
! !!
! !
! !!
!!
1 ! 2 ! 2 2
! = + + 2 + 4
! ! !!
! !
1 ! 9 ! ! 4 ! 9 !
! = 0 + + 3 + + 16 + + 6
4 4 4 4
= 0
Page
|
A13
Beckerman
Lab
2
Digital
Signal
Processing
An
Derivation:
!!
1
! = cos
!
-
is
the
function
that
describes
the
wave
=
(
is
the
period
of
the
wave
function)
For
a
triangle
wave,
the
function
is
a
piecewise
-
an
integer
multiplier
of
sinusoids
used
to
approximate
the
function
() =
< <
-
is
the
time
in
seconds
[s]
() = +
< <
=
a
grouping
of
constants
for
simplifying
() =
< <
! !!
!!
1 ! !
! = ! cos + ! cos + ! cos
! ! !!
! !
! !!
!!
1 ! 2 ! 2 2
! = cos + + 2 cos + 4 cos
! ! !!
! !
! = !! + !! + !!
!
= cos
!
= = cos
=
sin
=
! !
sin
= sin
! !
cos () !
= sin +
! !
!
= cos
!
!
sin
=
!
!
2 ! 2 =
!! = ! cos = ! 1 2
! =0
Page
|
A14
Beckerman
Lab
2
Digital
Signal
Processing
2 ! ! 0 !
!! = sin + ! ! cos sin 0 + ! ! cos 0
! 2 2 2
= +
!! !! 3
2 2 2 2 =
! ! 2
!! = ! cos + cos = ! 1 + 2
! ! =
! ! 2
3
2 3 ! 3 ! 3 ! ! 2 sin 2 sin
2
!! = ! sin + ! ! cos sin + ! ! cos +
2 2 2 2 2 2
= + + + =
!! !! = 2
2 4 2 4
!! = cos cos = 1 2 3
! !! !! ! =
! ! 2
3
2 2 ! ! 3 ! 3 ! 3 4 sin 2 sin
!! = ! sin 2 + ! ! cos 2 sin + ! ! cos 2
2 2 2
= + +
= + +
+ =
Page
|
A15
Beckerman
Lab
2
Digital
Signal
Processing
Bn
Derivation:
!!
1
! = sin
!
-
is
the
function
that
describes
the
wave
=
(
is
the
period
of
the
wave
function)
For
a
triangle
wave,
the
function
is
a
piecewise
-
an
integer
multiplier
of
sinusoids
used
to
approximate
the
function
() =
< <
-
is
the
time
in
seconds
[s]
() = +
< <
=
a
grouping
of
constants
for
simplifying
() =
< <
! !!
!!
1 ! !
! = ! sin + ! sin + ! sin
! ! !!
! !
! !!
!!
1 ! 2 ! 2 2
! = sin + + 2 sin + 4 sin
! ! !!
! !
! = !! + !! + !!
!
= sin
!
= = sin
=
cos
=
! !
cos
= cos
! !
sin () !
= cos +
! !
!
= sin
!
!
cos
=
!
!
2 ! 2 =
!! = ! sin = ! 3 2
! =0
Page
|
A16
Beckerman
Lab
2
Digital
Signal
Processing
2 ! ! 0 !
!! = cos + ! ! sin cos 0 + ! ! sin 0
! 2 2 2
= +
!! !! 3
2 2 2 2 =
! ! 2
!! = ! sin + sin = ! 3 + 4
! ! =
! ! 2
3
2 3 ! 3 ! 3 ! ! 2 cos 2 cos
2
!! = ! cos + ! ! sin cos + ! ! sin + +
2 2 2 2 2 2
= + + =
!! !! = 2
2 4 2 4
!! = sin sin = 3 4 3
! !! !! ! =
! ! 2
3
2 2 ! ! 3 ! 3 ! 3 4 cos 2 cos
!! = ! cos 2 + ! ! sin 2 cos + ! ! sin + 2
2 2 2
= + + +
= + +
Page
|
A17
Beckerman
Lab
2
Digital
Signal
Processing
E. MATLAB CODE
Page
|
A18
Beckerman
Lab
2
Digital
Signal
Processing
%Josh Beckerman
%Dr. Glauser
%MAE 315 - Mechanical and Aerospace Engineering Lab
%October 18, 2015
% %% Wave Functions
%
% syms a t l
%
% %function to approximate any sine wave
% sinf = a*sin(pi*t/l); %0 < t < T
%
% %function to approximate any square wave
% squaref(1) = a; %0 < t < T/2
% squaref(2) = -a; %T/2 < t < T
%
% %function to approximate any triangle wave
% trianglef(1) = (2*a*t)/l; % 0 < t < T/4
% trianglef(2) = (-(2*a)/l)*t + 2*a; % T/4 < t < 3T/4
% trianglef(3) = ((2*a)/l)*t - 4*a; % 3T/4 < t < T
Sim1a = dlmread('Lab2_Plot1_10_8_2015dat.txt','\t',1,0);
Sim1a_t = Sim1a(:,1);
Sim1a_V = Sim1a(:,2);
Sim1b = dlmread('Lab2_Plot1_10_8_2015fft.txt','\t',1,0);
Sim1b_f = Sim1b(:,1);
Sim1b_V = Sim1b(:,2);
%Uncertainty
basic = ones(1,10);
u_V1 = basic * 10/(2^12); %+/-10V Input Range, 12 Bit Resolution
u_t = basic * (Sim1a(2)-Sim1a_t(1))/2; %Half smallest increment of time
a = max(Sim1a_V);
l = 1/(2*freq1);
Page
|
A19
Beckerman
Lab
2
Digital
Signal
Processing
n = 1;
%f1 = Reconstruct(Sim1a_t,sinf,l,n,a);
A0 = 0;
An = 0;
Bn = a;
SineRecon = Bn * sin((n*pi*Sim1a_t)/l);
figure(1);
subplot(2,1,1);
plot(Sim1a_t,Sim1a_V,Sim1a_t,SineRecon)
hold on
errorbar(Sim1a_t(1:10:100),Sim1a_V(1:10:100),u_V1,u_V1,'.b')
hold on
herrorbar(Sim1a_t(1:10:100),Sim1a_V(1:10:100),u_t,u_t,'.b')
hold on
title({'Simulation 1, Sine Wave'; 'Time Domain'})
xlabel('Time [s]')
ylabel('Voltage [V]')
xlim([Sim1a_t(1) Sim1a_t(70)])
ylim([-8 8])
axis on
grid on
legend('Simulation 1', 'Reconstruction n = 1')
subplot(2,1,2);
plot(Sim1b_f,Sim1b_V)
hold on
plot(n*freq1,Bn,'Marker','*','MarkerSize', 15,'MarkerEdgeColor','b');
hold on
errorbar(Sim1b_f(1:50:500),Sim1b_V(1:50:500),u_V1,u_V1,'.b')
hold on
herrorbar(Sim1b_f(1:50:500),Sim1b_V(1:50:500),u_t,u_t,'.b')
hold on
title({'Simulation 1, Sine Wave'; 'Frequency Domain'})
xlabel('Frequency [Hz]')
ylabel('Voltage [V]')
xlim([0 2000])
ylim([0 7])
axis on
grid on
legend('Simulation 1', 'Reconstruction n = 1')
Page
|
A20
Beckerman
Lab
2
Digital
Signal
Processing
Sim2a_t = Sim2a(:,1); %assign data to time
Sim2a_V = Sim2a(:,2); %assign data to volts
%Uncertainty
basic = ones(1,10);
u_V2 = basic * 10/(2^12); %+/-10V Input Range, 12 Bit Resolution
u_t = basic * (Sim2a(2)-Sim2a_t(1))/2; %Half smallest increment of time
figure(2);
subplot(2,1,1);
plot(Sim2a_t,Sim2a_V)
hold on
errorbar(Sim2a_t(1:10:100),Sim2a_V(1:10:100),u_V2,u_V2,'.b')
hold on
herrorbar(Sim2a_t(1:10:100),Sim2a_V(1:10:100),u_t,u_t,'.b')
hold on
title({'Simulation 2, Square Wave with Low-Pass Filter'; 'Time Domain'})
xlabel('Time [s]')
ylabel('Voltage [V]')
xlim([Sim2a_t(1) Sim2a_t(70)])
ylim([-8 8])
axis on
grid on
subplot(2,1,2);
plot(Sim2b_f,Sim2b_V)
hold on
errorbar(Sim2b_f(1:50:500),Sim2b_V(1:50:500),u_V2,u_V2,'.b')
hold on
herrorbar(Sim2b_f(1:50:500),Sim2b_V(1:50:500),u_t,u_t,'.b')
hold on
title({'Simulation 2, Square Wave with Low-Pass Filter'; 'Frequency Domain'})
xlabel('Frequency [Hz]')
ylabel('Voltage [V]')
ylim([0 6])
axis on
grid on
Page
|
A21
Beckerman
Lab
2
Digital
Signal
Processing
Sim3a_t = Sim3a(:,1); %assign data to time
Sim3a_V = Sim3a(:,2); %assign data to volts
%Uncertainty
basic = ones(1,10);
u_V3 = basic * 10/(2^12); %+/-10V Input Range, 12 Bit Resolution
u_t = basic * (Sim3a(2)-Sim3a_t(1))/2; %Half smallest increment of time
freq3 = 600; % in Hz
a = max(Sim3a_V); %amplitude
l = 1/(2*freq3); %half the period
n = 1;
% f3 = Reconstruct(Sim3a_t,sinf,l,n,a);
SquareRecon1 = 0;
A0 = 0;
An = 0;
for i = [1:n]
BnSQ1 = ((2*a)/(i*pi))*(1-((-1)^i));
Recon = BnSQ1 * sin((i*pi*Sim3a_t)/l);
n = 3;
SquareRecon2 = 0;
A0 = 0;
An = 0;
for i = [1:n]
BnSQ2 = ((2*a)/(i*pi))*(1-((-1)^i));
Recon = BnSQ2 * sin((i*pi*Sim3a_t)/l);
n = 5;
SquareRecon3 = 0;
A0 = 0;
An = 0;
for i = [1:n]
BnSQ3 = ((2*a)/(i*pi))*(1-((-1)^i));
Recon = BnSQ3 * sin((i*pi*Sim3a_t)/l);
n = 7;
SquareRecon4 = 0;
Page
|
A22
Beckerman
Lab
2
Digital
Signal
Processing
A0 = 0;
An = 0;
for i = [1:n]
BnSQ4 = ((2*a)/(i*pi))*(1-((-1)^i));
Recon = BnSQ4 * sin((i*pi*Sim3a_t)/l);
figure(3);
subplot(2,1,1);
plot(Sim3a_t,Sim3a_V,Sim3a_t,SquareRecon1,Sim3a_t,SquareRecon2,Sim3a_t,SquareRecon3,Sim3a_t,Squar
eRecon4)
hold on
errorbar(Sim3a_t(1:10:100),Sim3a_V(1:10:100),u_V3,u_V3,'.b')
hold on
herrorbar(Sim3a_t(1:10:100),Sim3a_V(1:10:100),u_t,u_t,'.b')
hold on
title({'Simulation 3, Square Wave'; 'Time Domain'})
xlabel('Time [s]')
ylabel('Voltage [V]')
xlim([Sim3a_t(1) Sim3a_t(70)])
ylim([-8 8])
axis on
grid on
legend('Simulation 3', 'Reconstruction n = 1','Reconstruction n = 3','Reconstruction n =
5','Reconstruction n = 7')
subplot(2,1,2);
plot(Sim3b_f,Sim3b_V)
hold on
plot(1*freq3,BnSQ1,'Marker','*','MarkerSize', 15,'MarkerEdgeColor','g');
hold on
plot(3*freq3,BnSQ2,'Marker','*','MarkerSize', 15,'MarkerEdgeColor','r');
hold on
plot(5*freq3,BnSQ3,'Marker','*','MarkerSize', 15,'MarkerEdgeColor','c');
hold on
plot(7*freq3,BnSQ4,'Marker','*','MarkerSize', 15,'MarkerEdgeColor','m');
hold on
errorbar(Sim3b_f(1:50:500),Sim3b_V(1:50:500),u_V3,u_V3,'.b')
hold on
herrorbar(Sim3b_f(1:50:500),Sim3b_V(1:50:500),u_t,u_t,'.b')
hold on
title({'Simulation 3, Square Wave'; 'Frequency Domain'})
xlabel('Frequency [Hz]')
ylabel('Voltage [V]')
ylim([0 8])
axis on
grid on
legend('Simulation 3', 'Reconstruction n = 1', 'Reconstruction n = 3', 'Reconstruction n = 5',
'Reconstruction n = 7')
Page
|
A23
Beckerman
Lab
2
Digital
Signal
Processing
Sim4a = dlmread('Lab2_Plot4_10_8_2015dat.txt','\t',1,0);
Sim4a_t = Sim4a(:,1);
Sim4a_V = Sim4a(:,2);
Sim4b = dlmread('Lab2_Plot4_10_8_2015fft.txt','\t',1,0);
Sim4b_f = Sim4b(:,1);
Sim4b_V = Sim4b(:,2);
%Uncertainty
basic = ones(1,10);
u_V4 = basic * 10/(2^12); %+/-10V Input Range, 12 Bit Resolution
u_t = basic * (Sim4a(2)-Sim4a_t(1))/2; %Half smallest increment of time
figure(4);
subplot(2,1,1);
plot(Sim4a_t,Sim4a_V)
hold on
errorbar(Sim4a_t(1:10:100),Sim4a_V(1:10:100),u_V4,u_V4,'.b')
hold on
herrorbar(Sim4a_t(1:10:100),Sim4a_V(1:10:100),u_t,u_t,'.b')
hold on
title({'Simulation 4, Triangle Wave with Low-Pass Filter'; 'Time Domain'})
xlabel('Time [s]')
ylabel('Voltage [V]')
xlim([Sim4a_t(1) Sim4a_t(70)])
ylim([-8 8])
axis on
grid on
subplot(2,1,2);
plot(Sim4b_f,Sim4b_V)
hold on
errorbar(Sim4b_f(1:50:500),Sim4b_V(1:50:500),u_V4,u_V4,'.b')
hold on
herrorbar(Sim4b_f(1:50:500),Sim4b_V(1:50:500),u_t,u_t,'.b')
hold on
title({'Simulation 4, Triangle Wave with Low-Pass Filter'; 'Frequency Domain'})
xlabel('Frequency [Hz]')
ylabel('Voltage [V]')
ylim([0 6])
axis on
grid on
Page
|
A24
Beckerman
Lab
2
Digital
Signal
Processing
Sim5a = dlmread('Lab2_Plot5_10_8_2015dat.txt','\t',1,0);
Sim5a_t = Sim5a(:,1);
Sim5a_V = Sim5a(:,2);
Sim5b = dlmread('Lab2_Plot5_10_8_2015fft.txt','\t',1,0);
Sim5b_f = Sim5b(:,1);
Sim5b_V = Sim5b(:,2);
%Uncertainty
basic = ones(1,10);
u_V5 = basic * 10/(2^12); %+/-10V Input Range, 12 Bit Resolution
u_t = basic * (Sim5a(2)-Sim5a_t(1))/2; %Half smallest increment of time
a = max(Sim5a_V);
l = 1/(2*freq5);
n = 1;
%f5 = Reconstruct(Sim5a_t,sinf,l,x,a);
TriRecon1 = 0;
A0 = 0;
An = 0;
for i = [1:2:n]
BnTr1 = ((8*a)/(pi^2))*((-1)^((i-1)/2))/(i^2);
Recon = BnTr1 * sin((i*pi*Sim5a_t)/l);
n = 3;
TriRecon2 = 0;
A0 = 0;
An = 0;
for i = [1:2:n]
BnTr2 = ((8*a)/(pi^2))*((-1)^((i-1)/2))/(i^2);
Recon = BnTr2 * sin((i*pi*Sim5a_t)/l);
n = 5;
TriRecon3 = 0;
A0 = 0;
An = 0;
for i = [1:2:n]
Page
|
A25
Beckerman
Lab
2
Digital
Signal
Processing
BnTr3 = ((8*a)/(pi^2))*((-1)^((i-1)/2))/(i^2);
Recon = BnTr3 * sin((i*pi*Sim5a_t)/l);
n = 7;
TriRecon4 = 0;
A0 = 0;
An = 0;
for i = [1:2:n]
BnTr4 = ((8*a)/(pi^2))*((-1)^((i-1)/2))/(i^2);
Recon = BnTr4 * sin((i*pi*Sim5a_t)/l);
figure(5);
subplot(2,1,1);
plot(Sim5a_t,Sim5a_V,Sim5a_t,TriRecon1,Sim5a_t,TriRecon2,Sim5a_t,TriRecon3,Sim5a_t,TriRecon4)
hold on
errorbar(Sim5a_t(1:10:100),Sim5a_V(1:10:100),u_V5,u_V5,'.b')
hold on
herrorbar(Sim5a_t(1:10:100),Sim5a_V(1:10:100),u_t,u_t,'.b')
hold on
title({'Simulation 5, Triangle Wave'; 'Time Domain'})
xlabel('Time [s]')
ylabel('Voltage [V]')
xlim([Sim5a_t(1) Sim5a_t(70)])
ylim([-8 8])
axis on
grid on
legend('Simulation 5', 'Reconstruction n = 1','Reconstruction n = 3','Reconstruction n =
5','Reconstruction n = 7')
subplot(2,1,2);
plot(Sim5b_f,Sim5b_V)
hold on
plot(1*freq5,BnTr1,'Marker','*','MarkerSize', 15,'MarkerEdgeColor','g');
hold on
plot(3*freq5,-BnTr2,'Marker','*','MarkerSize', 15,'MarkerEdgeColor','r');
hold on
plot(5*freq5,BnTr3,'Marker','*','MarkerSize', 15,'MarkerEdgeColor','c');
hold on
plot(7*freq5,-BnTr4,'Marker','*','MarkerSize', 15,'MarkerEdgeColor','m');
hold on
errorbar(Sim5b_f(1:50:500),Sim5b_V(1:50:500),u_V5,u_V5,'.b')
hold on
herrorbar(Sim5b_f(1:50:500),Sim5b_V(1:50:500),u_t,u_t,'.b')
hold on
title({'Simulation 5, Triangle Wave'; 'Frequency Domain'})
xlabel('Frequency [Hz]')
Page
|
A26
Beckerman
Lab
2
Digital
Signal
Processing
ylabel('Voltage [V]')
ylim([0 6])
axis on
grid on
legend('Simulation 5', 'Reconstruction n = 1','Reconstruction n = 3','Reconstruction n =
5','Reconstruction n = 7')
Sim6a = dlmread('Lab2_Plot6_10_8_2015dat.txt','\t',1,0);
Sim6a_t = Sim6a(:,1);
Sim6a_V = Sim6a(:,2);
Sim6b = dlmread('Lab2_Plot6_10_8_2015fft.txt','\t',1,0);
Sim6b_f = Sim6b(:,1);
Sim6b_V = Sim6b(:,2);
%Uncertainty
basic = ones(1,10);
u_V6 = basic * 10/(2^12); %+/-10V Input Range, 12 Bit Resolution
u_t = basic * (Sim6a(2)-Sim6a_t(1))/2; %Half smallest increment of time
figure(6);
subplot(2,1,1);
plot(Sim6a_t,Sim6a_V)
hold on
errorbar(Sim6a_t(1:10:100),Sim6a_V(1:10:100),u_V6,u_V6,'.b')
hold on
herrorbar(Sim6a_t(1:10:100),Sim6a_V(1:10:100),u_t,u_t,'.b')
hold on
title({'Simulation 6, Sine Wave: 12 Bit Resolution'; 'Time Domain'})
xlabel('Time [s]')
ylabel('Voltage [V]')
xlim([Sim6a_t(1) Sim6a_t(70)])
ylim([-8 8])
axis on
grid on
subplot(2,1,2);
plot(Sim6b_f,Sim6b_V)
hold on
errorbar(Sim6b_f(1:50:500),Sim6b_V(1:50:500),u_V6,u_V6,'.b')
hold on
herrorbar(Sim6b_f(1:50:500),Sim6b_V(1:50:500),u_t,u_t,'.b')
hold on
Page
|
A27
Beckerman
Lab
2
Digital
Signal
Processing
title({'Simulation 6, Sine Wave: 12 Bit Resolution'; 'Frequency Domain'})
xlabel('Frequency [Hz]')
ylabel('Voltage [V]')
xlim([0 2000])
ylim([0 7])
axis on
grid on
Sim7a = dlmread('Lab2_Plot7_10_8_2015dat.txt','\t',1,0);
Sim7a_t = Sim7a(:,1);
Sim7a_V = Sim7a(:,2);
Sim7b = dlmread('Lab2_Plot7_10_8_2015fft.txt','\t',1,0);
Sim7b_f = Sim7b(:,1);
Sim7b_V = Sim7b(:,2);
%Uncertainty
basic = ones(1,10);
u_V7 = basic * 10/(2^4); %+/-10V Input Range, 12 Bit Resolution
u_t = basic * (Sim7a(2)-Sim7a_t(1))/2; %Half smallest increment of time
figure(7);
subplot(2,1,1);
plot(Sim7a_t,Sim7a_V)
hold on
errorbar(Sim7a_t(1:10:100),Sim7a_V(1:10:100),u_V7,u_V7,'.b')
hold on
herrorbar(Sim7a_t(1:10:100),Sim7a_V(1:10:100),u_t,u_t,'.b')
hold on
title({'Simulation 7, Sine Wave: 4 Bit Resolution'; 'Time Domain'})
xlabel('Time [s]')
ylabel('Voltage [V]')
xlim([Sim7a_t(1) Sim7a_t(70)])
ylim([-8 8])
axis on
grid on
subplot(2,1,2);
plot(Sim7b_f,Sim7b_V)
hold on
errorbar(Sim7b_f(1:50:500),Sim7b_V(1:50:500),u_V7,u_V7,'.b')
hold on
herrorbar(Sim7b_f(1:50:500),Sim7b_V(1:50:500),u_t,u_t,'.b')
Page
|
A28
Beckerman
Lab
2
Digital
Signal
Processing
hold on
title({'Simulation 7, Sine Wave: 12 Bit Resolution'; 'Frequency Domain'})
xlabel('Frequency [Hz]')
ylabel('Voltage [V]')
xlim([0 2000])
ylim([0 7])
axis on
grid on
Sim8a = dlmread('Lab2_Plot8_10_8_2015dat.txt','\t',1,0);
Sim8a_t = Sim8a(:,1);
Sim8a_V = Sim8a(:,2);
Sim8b = dlmread('Lab2_Plot8_10_8_2015fft.txt','\t',1,0);
Sim8b_f = Sim8b(:,1);
Sim8b_V = Sim8b(:,2);
%Uncertainty
basic = ones(1,10);
u_V8 = basic * 10/(2^12); %+/-10V Input Range, 12 Bit Resolution
u_t = basic * (Sim8a(2)-Sim8a_t(1))/2; %Half smallest increment of time
figure(8);
subplot(2,1,1);
plot(Sim8a_t,Sim8a_V)
hold on
errorbar(Sim8a_t(1:10:100),Sim8a_V(1:10:100),u_V8,u_V8,'.b')
hold on
herrorbar(Sim8a_t(1:10:100),Sim8a_V(1:10:100),u_t,u_t,'.b')
hold on
title({'Simulation 8, Square Wave: 4 Bit Resolution'; 'Time Domain'})
xlabel('Time [s]')
ylabel('Voltage [V]')
xlim([Sim8a_t(1) Sim8a_t(70)])
ylim([-8 8])
axis on
grid on
subplot(2,1,2);
plot(Sim8b_f,Sim8b_V)
hold on
errorbar(Sim8b_f(1:50:500),Sim8b_V(1:50:500),u_V8,u_V8,'.b')
hold on
Page
|
A29
Beckerman
Lab
2
Digital
Signal
Processing
herrorbar(Sim8b_f(1:50:500),Sim8b_V(1:50:500),u_t,u_t,'.b')
hold on
title({'Simulation 8, Square Wave: 12 Bit Resolution'; 'Frequency Domain'})
xlabel('Frequency [Hz]')
ylabel('Voltage [V]')
ylim([0 7])
axis on
grid on
Sim9a = dlmread('Lab2_Plot9_10_8_2015dat.txt','\t',1,0);
Sim9a_t = Sim9a(:,1);
Sim9a_V = Sim9a(:,2);
Sim9b = dlmread('Lab2_Plot9_10_8_2015fft.txt','\t',1,0);
Sim9b_f = Sim9b(:,1);
Sim9b_V = Sim9b(:,2);
%Uncertainty
basic = ones(1,10);
u_V9 = basic * 10/(2^12); %+/-10V Input Range, 12 Bit Resolution
u_t = basic * (Sim9a(2)-Sim9a_t(1))/2; %Half smallest increment of time
figure(9);
subplot(2,1,1);
plot(Sim9a_t,Sim9a_V)
hold on
errorbar(Sim9a_t(1:10:100),Sim9a_V(1:10:100),u_V9,u_V9,'.b')
hold on
herrorbar(Sim9a_t(1:10:100),Sim9a_V(1:10:100),u_t,u_t,'.b')
hold on
title({'Simulation 9, Sine Wave'; 'Time Domain'})
xlabel('Time [s]')
ylabel('Voltage [V]')
xlim([Sim9a_t(1) Sim9a_t(70)])
ylim([-8 8])
axis on
grid on
subplot(2,1,2);
plot(Sim9b_f,Sim9b_V)
hold on
errorbar(Sim9b_f(1:50:500),Sim9b_V(1:50:500),u_V1,u_V1,'.b')
hold on
Page
|
A30
Beckerman
Lab
2
Digital
Signal
Processing
herrorbar(Sim9b_f(1:50:500),Sim9b_V(1:50:500),u_t,u_t,'.b')
hold on
title({'Simulation 9, Sine Wave'; 'Frequency Domain'})
xlabel('Frequency [Hz]')
ylabel('Voltage [V]')
ylim([0 7])
axis on
grid on
Sim10a = dlmread('Lab2_Plot10_10_8_2015dat.txt','\t',1,0);
Sim10a_t = Sim10a(:,1);
Sim10a_V = Sim10a(:,2);
Sim10b = dlmread('Lab2_Plot10_10_8_2015fft.txt','\t',1,0);
Sim10b_f = Sim10b(:,1);
Sim10b_V = Sim10b(:,2);
%Uncertainty
basic = ones(1,10);
u_V10 = basic * 10/(2^12); %+/-10V Input Range, 12 Bit Resolution
u_t = basic * (Sim10a(2)-Sim10a_t(1))/2; %Half smallest increment of time
figure(10);
subplot(2,1,1);
plot(Sim10a_t,Sim10a_V)
hold on
errorbar(Sim10a_t(1:10:100),Sim10a_V(1:10:100),u_V10,u_V10,'.b')
hold on
herrorbar(Sim10a_t(1:10:100),Sim10a_V(1:10:100),u_t,u_t,'.b')
hold on
title({'Simulation 10, Sine Wave: Bipolar voltage +/-1.0V'; 'Time Domain'})
xlabel('Time [s]')
ylabel('Voltage [V]')
xlim([Sim10a_t(1) Sim10a_t(70)])
ylim([-8 8])
axis on
grid on
subplot(2,1,2);
plot(Sim10b_f,Sim10b_V)
hold on
errorbar(Sim10b_f(1:50:500),Sim10b_V(1:50:500),u_V10,u_V10,'.b')
hold on
Page
|
A31
Beckerman
Lab
2
Digital
Signal
Processing
herrorbar(Sim10b_f(1:50:500),Sim10b_V(1:50:500),u_t,u_t,'.b')
hold on
title({'Simulation 10, Sine Wave: Bipolar voltage +/-1.0V'; 'Frequency Domain'})
xlabel('Frequency [Hz]')
ylabel('Voltage [V]')
ylim([0 7])
axis on
grid on
Sim11a = dlmread('Lab2_Plot11_10_8_2015dat.txt','\t',1,0);
Sim11a_t = Sim11a(:,1);
Sim11a_V = Sim11a(:,2);
Sim11b = dlmread('Lab2_Plot11_10_8_2015fft.txt','\t',1,0);
Sim11b_f = Sim11b(:,1);
Sim11b_V = Sim11b(:,2);
%Uncertainty
basic = ones(1,10);
u_V11 = basic * 10/(2^12); %+/-10V Input Range, 12 Bit Resolution
u_t = basic * (Sim11a(2)-Sim11a_t(1))/2; %Half smallest increment of time
figure(11);
subplot(2,1,1);
plot(Sim11a_t,Sim11a_V)
hold on
errorbar(Sim11a_t(1:10:100),Sim11a_V(1:10:100),u_V11,u_V11,'.b')
hold on
herrorbar(Sim11a_t(1:10:100),Sim11a_V(1:10:100),u_t,u_t,'.b')
hold on
title({'Experiment 11, Sine Wave'; 'Time Domain'})
xlabel('Time [s]')
ylabel('Voltage [V]')
xlim([Sim11a_t(1) Sim11a_t(70)])
ylim([-8 8])
axis on
grid on
subplot(2,1,2);
plot(Sim11b_f,Sim11b_V)
hold on
errorbar(Sim11b_f(1:50:500),Sim11b_V(1:50:500),u_V11,u_V11,'.b')
hold on
Page
|
A32
Beckerman
Lab
2
Digital
Signal
Processing
herrorbar(Sim11b_f(1:50:500),Sim11b_V(1:50:500),u_t,u_t,'.b')
hold on
title({'Experiment 11, Sine Wave'; 'Frequency Domain'})
xlabel('Frequency [Hz]')
ylabel('Voltage [V]')
ylim([0 7])
axis on
grid on
Sim12a = dlmread('Lab2_Plot12_10_8_2015dat.txt','\t',1,0);
Sim12a_t = Sim12a(:,1);
Sim12a_V = Sim12a(:,2);
Sim12b = dlmread('Lab2_Plot12_10_8_2015fft.txt','\t',1,0);
Sim12b_f = Sim12b(:,1);
Sim12b_V = Sim12b(:,2);
%Uncertainty
basic = ones(1,10);
u_V12 = basic * 10/(2^12); %+/-10V Input Range, 12 Bit Resolution
u_t = basic * (Sim12a(2)-Sim12a_t(1))/2; %Half smallest increment of time
figure(12);
subplot(2,1,1);
plot(Sim12a_t,Sim12a_V)
hold on
errorbar(Sim12a_t(1:10:100),Sim12a_V(1:10:100),u_V12,u_V12,'.b')
hold on
herrorbar(Sim12a_t(1:10:100),Sim12a_V(1:10:100),u_t,u_t,'.b')
hold on
title({'Experiment 12, Sine Wave: 900Hz Sampling Frequency'; 'Time Domain'})
xlabel('Time [s]')
ylabel('Voltage [V]')
xlim([Sim12a_t(1) Sim12a_t(70)])
ylim([-8 8])
axis on
grid on
subplot(2,1,2);
plot(Sim12b_f,Sim12b_V)
hold on
errorbar(Sim12b_f(1:50:500),Sim12b_V(1:50:500),u_V12,u_V12,'.b')
hold on
Page
|
A33
Beckerman
Lab
2
Digital
Signal
Processing
herrorbar(Sim12b_f(1:50:500),Sim12b_V(1:50:500),u_t,u_t,'.b')
hold on
title({'Experiment 12, Sine Wave: 900Hz Sampling Frequency'; 'Frequency Domain'})
xlabel('Frequency [Hz]')
ylabel('Voltage [V]')
ylim([0 7])
axis on
grid on
Sim13a = dlmread('Lab2_Plot13_10_8_2015dat.txt','\t',1,0);
Sim13a_t = Sim13a(:,1);
Sim13a_V = Sim13a(:,2);
Sim13b = dlmread('Lab2_Plot13_10_8_2015fft.txt','\t',1,0);
Sim13b_f = Sim13b(:,1);
Sim13b_V = Sim13b(:,2);
%Uncertainty
basic = ones(1,10);
u_V13 = basic * 10/(2^12); %+/-10V Input Range, 12 Bit Resolution
u_t = basic * (Sim13a(2)-Sim13a_t(1))/2; %Half smallest increment of time
figure(13);
subplot(2,1,1);
plot(Sim13a_t,Sim13a_V)
hold on
errorbar(Sim13a_t(1:10:100),Sim13a_V(1:10:100),u_V13,u_V13,'.b')
hold on
herrorbar(Sim13a_t(1:10:100),Sim13a_V(1:10:100),u_t,u_t,'.b')
hold on
title({'Experiment 13, Sine Wave: Krohn-Hite Filter'; 'Time Domain'})
xlabel('Time [s]')
ylabel('Voltage [V]')
xlim([Sim13a_t(1) Sim13a_t(70)])
ylim([-8 8])
axis on
grid on
subplot(2,1,2);
plot(Sim13b_f,Sim13b_V)
hold on
errorbar(Sim13b_f(1:50:500),Sim13b_V(1:50:500),u_V13,u_V13,'.b')
hold on
Page
|
A34
Beckerman
Lab
2
Digital
Signal
Processing
herrorbar(Sim13b_f(1:50:500),Sim13b_V(1:50:500),u_t,u_t,'.b')
hold on
title({'Experiment 13, Sine Wave: Krohn-Hite Filter'; 'Frequency Domain'})
xlabel('Frequency [Hz]')
ylabel('Voltage [V]')
ylim([0 7])
axis on
grid on
Sim14a = dlmread('Lab2_Plot14_10_8_2015dat.txt','\t',1,0);
Sim14a_t = Sim14a(:,1);
Sim14a_V = Sim14a(:,2);
Sim14b = dlmread('Lab2_Plot14_10_8_2015fft.txt','\t',1,0);
Sim14b_f = Sim14b(:,1);
Sim14b_V = Sim14b(:,2);
%Uncertainty
basic = ones(1,10);
u_V14 = basic * 10/(2^12); %+/-10V Input Range, 12 Bit Resolution
u_t = basic * (Sim14a(2)-Sim14a_t(1))/2; %Half smallest increment of time
figure(14);
subplot(2,1,1);
plot(Sim14a_t,Sim14a_V)
hold on
errorbar(Sim14a_t(1:10:100),Sim14a_V(1:10:100),u_V14,u_V14,'.b')
hold on
herrorbar(Sim14a_t(1:10:100),Sim14a_V(1:10:100),u_t,u_t,'.b')
hold on
title({'Experiment 14, Square Wave'; 'Time Domain'})
xlabel('Time [s]')
ylabel('Voltage [V]')
xlim([Sim14a_t(1) Sim14a_t(70)])
ylim([-8 8])
axis on
grid on
subplot(2,1,2);
plot(Sim14b_f,Sim14b_V)
hold on
errorbar(Sim14b_f(1:50:500),Sim14b_V(1:50:500),u_V14,u_V14,'.b')
hold on
herrorbar(Sim14b_f(1:50:500),Sim14b_V(1:50:500),u_t,u_t,'.b')
Page
|
A35
Beckerman
Lab
2
Digital
Signal
Processing
hold on
title({'Experiment 14, Square Wave'; 'Frequency Domain'})
xlabel('Frequency [Hz]')
ylabel('Voltage [V]')
ylim([0 7])
axis on
grid on
Sim15a = dlmread('Lab2_Plot15_10_8_2015dat.txt','\t',1,0);
Sim15a_t = Sim15a(:,1);
Sim15a_V = Sim15a(:,2);
Sim15b = dlmread('Lab2_Plot15_10_8_2015fft.txt','\t',1,0);
Sim15b_f = Sim15b(:,1);
Sim15b_V = Sim15b(:,2);
%Uncertainty
basic = ones(1,10);
u_V15 = basic * 10/(2^12); %+/-10V Input Range, 12 Bit Resolution
u_t = basic * (Sim15a(2)-Sim15a_t(1))/2; %Half smallest increment of time
figure(15);
subplot(2,1,1);
plot(Sim15a_t,Sim15a_V)
hold on
errorbar(Sim15a_t(1:10:100),Sim15a_V(1:10:100),u_V15,u_V15,'.b')
hold on
herrorbar(Sim15a_t(1:10:100),Sim15a_V(1:10:100),u_t,u_t,'.b')
hold on
title({'Experiment 15, Triangle Wave'; 'Time Domain'})
xlabel('Time [s]')
ylabel('Voltage [V]')
xlim([Sim15a_t(1) Sim15a_t(70)])
ylim([-8 8])
axis on
grid on
subplot(2,1,2);
plot(Sim15b_f,Sim15b_V)
hold on
errorbar(Sim15b_f(1:50:500),Sim15b_V(1:50:500),u_V15,u_V15,'.b')
hold on
herrorbar(Sim15b_f(1:50:500),Sim15b_V(1:50:500),u_t,u_t,'.b')
hold on
Page
|
A36
Beckerman
Lab
2
Digital
Signal
Processing
title({'Experiment 15, Triangle Wave'; 'Frequency Domain'})
xlabel('Frequency [Hz]')
ylabel('Voltage [V]')
ylim([0 7])
axis on
grid on
Sim16a = dlmread('Lab2_Plot16_10_8_2015dat.txt','\t',1,0);
Sim16a_t = Sim16a(:,1);
Sim16a_V = Sim16a(:,2);
Sim16b = dlmread('Lab2_Plot16_10_8_2015fft.txt','\t',1,0);
Sim16b_f = Sim16b(:,1);
Sim16b_V = Sim16b(:,2);
%Uncertainty
basic = ones(1,10);
u_V16 = basic * 10/(2^12); %+/-10V Input Range, 12 Bit Resolution
u_t = basic * (Sim16a(2)-Sim16a_t(1))/2; %Half smallest increment of time
figure(16);
subplot(2,1,1);
plot(Sim16a_t,Sim16a_V)
hold on
errorbar(Sim16a_t(1:10:100),Sim16a_V(1:10:100),u_V16,u_V16,'.b')
hold on
herrorbar(Sim16a_t(1:10:100),Sim16a_V(1:10:100),u_t,u_t,'.b')
hold on
title({'Experiment 16, White Noise'; 'Time Domain'})
xlabel('Time [s]')
ylabel('Voltage [V]')
xlim([Sim16a_t(1) Sim16a_t(70)])
ylim([-8 8])
axis on
grid on
subplot(2,1,2);
plot(Sim16b_f,Sim16b_V)
hold on
errorbar(Sim16b_f(1:50:500),Sim16b_V(1:50:500),u_V16,u_V16,'.b')
hold on
herrorbar(Sim16b_f(1:50:500),Sim16b_V(1:50:500),u_t,u_t,'.b')
hold on
title({'Experiment 16, White Noise'; 'Frequency Domain'})
Page
|
A37
Beckerman
Lab
2
Digital
Signal
Processing
xlabel('Frequency [Hz]')
ylabel('Voltage [V]')
ylim([0 7])
axis on
grid on
Page | A38