Documente Academic
Documente Profesional
Documente Cultură
Technology
Professorship of Measurement and Sensor Technology
Practical on
Digital Frequency Measurement
Literature:
1. Profos, P./ Pfeifer, T.: Grundlagen der Metechnik, Oldenbourg Verlag Mnchen
Wien 1997
2. Schrfer, E.: Elektrische Metechnik, Carl Hanser Verlag Mnchen Wien 2004
3. Schrfer, E.: Signalverarbeitung,Carl Hanser Verlag Mnchen Wien 1992
4. Best, R.: Digitale Mewertverarbeitung,Oldenbourg Verlag Mnchen Wien 1991
5. Best, R.: Digitale Signalverarbeitung und -simulation, vde-verlag gmbh Berlin
Offenbach, AT Verlag Aarau/Schweiz, 1993
6. v. Grningen, D.: Digitale Signalverarbeitung, AT Verlag Aarau/Schweiz 1993
7. Kammeyer K./ Kroschel, K.: Digitale Signalverarbeitung, Filterung und Spek-
tralanalyse mit MATLAB-bungen, B.G. Teubner Verlag Stuttgart/Leipzig
2002
8. Reinhard Lerch: Elektrische Messtechnik, analoge, digitale und computergesttzte,
Verfahren, Springer-Verlag , 2005
Objective:
Digital frequency measurement and period duration measurement in time domain
The sampling frequency fT akt is the clock reference frequency, see block diagram
in Figure-1, which is used to sample the measured signal fsample . The purpose
of the sampling is the analogue-to-digital conversion ADC of the measured signal
which is stored in a Digital Storage Oscilloscope (DSO). For the preparation of the
experiment, it is shown in Figure-2 a recorded example of a measured signal.
The Fourier transformation is the transition from time domain to frequency domain.
And it is often used as a tool in signal processing because it makes it possible to find
the recurring periodic signals and to determine the spectral distribution of a given
signal x(t). Therefore it is a standard method for revealing periodic structures in
data and functions. The analysis of signals is not the only application of the Fourier
transformation but it is also used in filter masks in the efficient convolution, in the
analysis and manipulation of vision frequency and in decompression. The Fourier
transform is subdivided into:
The inverse feature of the algorithm also enables the generation of signals. Both
transformations together form the Fourier transformation pair.
From that the Fourier transformed function of a sampled signal can be given as:
In the generalized form the coefficient TA written in front of the sum is left out.
A Fourier transformed sequence (of a discrete-time signals) is periodic, as well the
corresponding spectrum. The spectrum results from the sum of the spectra of Dirac
impulses that are time displaced and weighted by the values of the sampled signal.
Since there is generally a finite number of signal values (function values) the DFT
was developed. There the discrete signal values are located within a defined space
of time. The sampling of the signal delivers a finite number of sampling values (N
values). When proceeding from the Fourier transform of an infinite discrete signal
to the DFT the frequency is not a continuous variable anymore,A but a discrete
frequency k∆ω The spectrum is only calculated for a finite number of (radiant)
frequencies.
period and transform to get the full spectral information. The distance between two
adjacent frequency values/spectral lines is calculated as:
2π 1
∆ω = where∆f = (3)
N TA N TA
For the spectral resolution therefore the whole measuring time (N TA ) is decisive. If
the measuring time increases to infinite values then the spectral lines move closer
so that the distance between them becomes zero, which means that the line spec-
trum changes into a continuous spectrum. If the Nyquist theorem is fulfilled then
the spectrum of the discrete signal is identical with the spectrum of the continuous
π π 1 1
signal in the base interval − <ω< or − fA < f < fA respectively.
TA TA 2 2
The Nyquist theorem says that the sampling frequency has to be at least twice as
high as the maximum frequency of the signal. If the sampling frequency is high
enough then the spectra of continuous signals can be replaced by the spectra of the
sampled signals. If the Nyquist theorem is violated then the original signal will be
distorted (aliasing in time domain).
The calculated spectral sequence of N dots generally shows symmetric features there-
fore it would be sufficient to calculate just half the amount of spectral values. For
calculating all N coefficients (spectral lines) ZM = N 2 complex multiplications are
necessary. The same partial products are calculated several times (redundant oper-
ations). By the elimination of redundancy the computational algorithm decreases
considerably, so that we speak about Fast Fourier Transform.
ZDF T = N 2 to ZF F T = N/2.log2 (N )
The FFT can be applied under the condition that the sequence of data that shall be
transformed contains a number N of values, whereas N has to be an integer number
calculated with this term: (two to the nth power) N = 2n E. g.: For N = 28 = 256
values the DFT requires ZDF T = 65536 multiplications, whereas the FFT just needs
ZF F T = 1024 ones. The effort to calculate when using the FFT is just about 1/50
when using the DFT. Further there are fewer errors that occur when rounding up
or down intermediate results.
The function sinN x/sinx has one main lobe and many minor lobes. The curve
enveloping the spectral lines shows the maximum amplitude of the main lobe for
f = 0 (regarding non-periodic signals) and the maximum amplitude of the main
lobe for f = f0 (regarding periodic signals). The amplitudes of the side lobes are
lower than the one of the main lobe. The roots of the enveloping curve lie where
the roots of the function sinN x/sinx are situated.
Z
A non-periodic time signal: fZ = (Z = ±1, ±2, ±3, ...)
N TA
Z
A periodic time signal: fZ = f0 + (Z = ±1, ±2, ±3, ...)
N TA
When the fundamental cycle duration T0 is known then the measurement time N TA
has to be chosen in that way that it is an i-fold of the cycle duration T0 , while i is
an integer.
N TA = iT0
In this case the DFT gives the maximum amplitude (spectral line) exactly at f = f0
and the other spectral lines are superposed by the roots of the enveloping curve. In
this way all other possible spectral lines can be extinguished. But if the width of
the window N TA (measuring time) is not an i-fold integer of the cycle duration then
considerable discontinuities in the form of side lines will occur. Wrong spectral lines
appear. This effect is called Leakage effect.
Type of window Highest minor lobe-a Maximum sampling error-b Width of the main lobe-c
Figure 3: Influence of the width of the measuring window on the resulting spectrum
Preparation Tasks
The sampling frequency that was used for the sampling of the time signal in the
DSO has the values of 20MHz, 10MHz, 4MHz or 2MHz respectively. The number
of sampling values is 2048 in any case.
1. What are the cycle durations for the given sampling frequencies?
2. Compare the characteristic values in time and frequency domain. Name the
interactions between (grid points) sampling rate, width of the measuring win-
dow (time domain), the number of (usable) spectral lines, frequency resolution
and the maximum frequency (frequency domain).
3. For which frequency range is it physically meaningful to describe the calculated
amplitude density spectrum?
4. For a periodic rectangular pulse (a periodic box-car pulse) amounts to the
ratio of pulse duration to period duration = window width T = 1/f0 , a) 1: 10
and b) 1: 100. At which frequencies (reference frequency f0) the calculation
gives roots in the spectrum?
5. Calculate the expected number of samples per cycle for the signals 1-8 we want
to analyze (see 5 Experimental procedure).
Sampled signal 1-4: fsampling = 20MHz
Sampled signal 5-8: fsampling = 4MHz
4. Experimental set-up
Figure-4 shows the application interface of the program. Essentially the handling is
self explaining. The signal is stored for 2048 sampling values (index 1 to 2048 where
the index range can be adjusted by the help of the ZOOM-function. Sampling mo-
ment and normalized amplitude of a selected single value can be shown by moving
the cursor. Furthermore the sampling frequency fsampling (Abtastfrequenz) at which
the signal (Normsignal) has been digitized is shown.
The stored time signal is transformed into frequency domain by FFT. The ampli-
tude of the spectrum is shown just for positive frequencies. The spectrum can be
calculated and shown for the measured signal multiplied by various time windows
with which the measured signal is multiplied in time domain.
In the submenu OPTIONS you can choose window functions, width and position of
the window by setting the grids number and the cursor. The default setting is the
rectangular function for all 2048 values. Then, the normalized amplitudes of the
single spectral lines are measurable by making zoom of the appropriate range and
the positioning the cursor at the desired spectral line.
5. Experimental Procedure
To start the program FFTANA, you first have to call the program MATLAB in
Windows. After that you input FFTANA. To perform the wanted tasks of this
experiment, below are listed time signals in the form of data files, e.g. the file name
(sin10 0) contains a sampled sinusoidal harmonic with 10 time periods shown and
recorded in the screen.
Click on the LOAD bottom in the interface of the program to select a signal file and
run it. The data are found in the path: C : \matlab4 \ toolbox \ df m \ ...
(a) Calculate the frequencies of the measured signals using number of cycles
and the sampling frequency. Give the values of the measurement devia-
tions (absolute and relative error) of each frequency that you determined
in this experiment.
(b) Discuss the results! Under which condition can you actually determine a
frequency from the sampled signal?
1. Transform the measuring signals 1-8 into frequency domain and discuss the
representation. The transformation always happens with a rectangular window
(idx 1-2048). Use the ZOOM function and if necessary print some examples
for further explanation (details about the zeros).
2. Load measuring signal 3 and find out the time interval for exactly one cycle
(idx j ...idx k). Open the submenu OPTION and set the idx-values. By
pushing OK you get back and see the time interval with detail showing the
single cycle. Transform this signal and discuss the result. Give reasons why
the spectral line with the maximum amplitude can lie on another frequency
than that determined easily in time domain. Repeat this task by setting other
time intervals you can choose on your own.
3. Load the measuring signal 12 (do not cut off the offset). Discuss the represen-
tation in time domain. Give the number of bits the A-D converter has to be
used when the measuring range for the sampling of the signal is 2V.
4. Show how the spectra of box-car pulses (rectangular) look like. The duration
of the pulses have to be set according to the preparation task 4 (OPTION).
Compare the roots with the calculated values.
5. Evaluate the spectra of box- car pulses according to task 4 for the follow-
ing pulse durations: six-, two- and one-fold of the sampling cycle duration!
Document what you find out.
6. Load measuring signal 6, make a window of 200 samples (from OPTIONS, e.g.
idx 100 to idx 300), show the spectrum with the ZOOM function. Calculate
the minima of the signal in the spectrum and decide whether an interpolation
within the main lobe of the spectrum is sensible. Calculate the measuring
frequency more exactly by using 6 spectral lines in your calculation (centroid
method). Compare the result with the frequency line that has the maximum
amplitude in the spectrum and with the evaluation in time domain.
7. The measuring signal 9 is a digitalized noise signal (white noise). Determine
the spectrum that is belonging to it and interpret the result.
8. Measuring signal 10 was measured as an output signal of an operational ampli-
fier, while the input quantity was white noise generated by a noise generator.
Determine the spectrum of the output signal, interpret it and compare it with
the result from task 7. How would the figure change if the signal was not
sampled just 2048 times, but with a measuring time (measuring window) that
is ten times longer, so that the signal is sampled 20,480 times now?
Organizational Information:
A sufficient preparation of the experiment is basically required. All preparation
tasks have to answer in written. Each group should submit one written preparation
tasks. The sources of using literature have to be indicated (scientific style). The
practical takes place in your own responsibility under the technical instruction from
the tutor. A report, that includes a rework preparation, all graphs and measured
data, as well as a detailed analysis, should be submitted. The report should be
submitted to the tutor in handwritten or printed form not later than 14 days after
the practical. One report for each labor group is adequate. All equipment and
facilities are handled with care.