Professional Documents
Culture Documents
ENGINEERING ANALYSIS 3
April 2014
Arnaud GIRIN 0616470
Table of Contents
1
Introduction..................................................................................................... 1
1.1
1.2
Section 1......................................................................................................... 2
2.1
2.2
2.3
3.2
3.3
3.4
Mathlab Code.................................................................................................. 8
List of figures
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
1 Introduction
The objective of this study is to demonstrate the effect of cutting out data on a
signal frequency domain.
Using the given readlvsgl_MEng_2014.m code the time domain signal plot and
frequency domain plot can be obtained from the A1010000.bin Labview file.
Criterion are to be set up to define threshold so that the data can be splitted in 3
sections.
2 10
Section
1
Section
2
Section
3
2 Section 1
2.1 Signal processing tool
Section 1 is the part of the time domain signal before the signal gets significant
values. This part has tiny fluctuations for about 2ms (about 1000 points). The
Matlab signal processing tool is used to zoom in to this section. Using the vertical
and horizontal markers the maximum values are determined.
The time domain variable containing 50 000 values is then cut out at the 984 th
value, which correspond to the last value within the set limit.
The Matlab command to cut this variable at the required value and put it into a
new variable is:
ys1=y(1:984)
The variable ys1 (s1: Section1) is created and only contains the 984 th values of
the main variable.
A similar operation is made to generate suitable x axis values:
xs1=x(1:984)
3 Section 2 and 3
Section 2 is surrounded by section 1 and 3. The first one has been determined so
the next step is to establish a suitable threshold to cut out section 3 so that only
the significant values for section 2 are kept for further studies.
The chosen threshold is based on a Signal to Noise of 100 (20dB) which means
that the threshold is set at 1% of the maximum amplitude recorder for the signal.
In this case, the maximum amplitude for the entire signal is 3.0293 (this value is
shown on the Matlab variable windows at the corresponding row). The upper
threshold is therefore set to 0.030293 and the lower one to -0.030293.
The 29391th value is the last value over the set threshold.
Figure 5: Plot of time domain showing the last value above the set up threshold
Knowing this value, the section 2 and 3 can be created in two different variables,
ys2 and ys3 (with corresponding xs2 and xs3 x axis values).
Using the pwelch function, the frequency domains of these two remaining
sections can be determined.
4 Mathlab Code
%==========================================================================
%==========================================================================
% Matlab m-files: Frequency_Domain_Section_1_2_3.m
% Author: Arnaud GIRIN
% Date: 29 April 2014
% Usage:
% - This routine uses with a function, readlvsgl_MEng_2014.m
% - Uses the generated x and y variables
% - Cuts out the variable into 3 sections according to predefined threshold
% - Output variables: xs1, xs2, xs3, ys1, ys2, ys3, pyys1, pyys2, pyys3
% - Uses pwelch function to turn the time domain variable into frequency
domain
% - Plot graphs of the time and frequency domain for the three sections
% - Put this routine and readlvsgl_MEng_2014.m in a matlab's default folder
(works) or add another path
%==========================================================================
readlvsgl_MEng_2014;
ys1=y(1:984);
xs1=x(1:984);
ys2=y(984:29391);
xs2=x(984:29391);
ys3=y(29391:50000);
xs3=x(29391:50000);
plot(xs1,ys1)
xlabel('Time (s)')
ylabel('Ampliture (V)')
title('Time domain signal - Section 1')
[pyys1,f] = pwelch(ys1,[],[],4096,fs);
f=f(1:821)
pyys1=pyys1(1:821)
figure
plot(f,pyys1)
title('Frequency domain - Section 1')
xlabel('Frequency (Hz)')
ylabel('Power spectral density')
[pyys2,f] = pwelch(ys2,[],[],4096,fs);
f=f(1:821)
pyys2=pyys2(1:821)
figure
plot(f,pyys2)
title('Frequency domain - Section 2')
xlabel('Frequency (Hz)')
ylabel('Power spectral density')
[pyys3,f] = pwelch(ys3,[],[],4096,fs);
f=f(1:821)
pyys3=pyys3(1:821)
figure
plot(f,pyys3)
title('Frequency domain - Section 3')
xlabel('Frequency (Hz)')
ylabel('Power spectral density')
10
Each frequency domain plot seen on this study comes with the highest value for
the entire plot, it can be seen that the highest value for section 2 (2.162x10 -5) is
twice as big as for section 1
(4.21x10-9) and 3 (6.316x1010).
Moreover, the frequency peaks for each sections are sometimes similar or close
to each other, this signal processing part help to purge the unnecessary data
that could lead to error.
The figure below shows the differences in amplitudes against frequency of both
the entire signal (pyy in blue) and the section 2 signal (pyys2).
The cut of the appropriate section has made the power spectral density higher
for section 2 than the entire signal. Eliminating unwanted data makes the data
more accurate and easy to study.
This proves the importance of selecting the right section for the desired data to
be studied.
Many other threshold criteria could have been used such as, using section 1
threshold for section 3 threshold. Also, the Matlab signal processing tool could
have been run with vertical markers with tracking and slope to use an angular
criteria for a threshold.
11
12