You are on page 1of 15

EN5500

ENGINEERING ANALYSIS 3

PART A: SIGNAL PROCESSING

April 2014
Arnaud GIRIN 0616470

Table of Contents
1

Introduction..................................................................................................... 1
1.1

Time domain signal plot............................................................................1

1.2

Frequency domain plot..............................................................................1

Section 1......................................................................................................... 2
2.1

Signal processing tool...............................................................................2

2.2

The time domain plot Section 1..............................................................3

2.3

Frequency domain plot Section 1...........................................................4

Section 2 and 3............................................................................................... 4


3.1

Time domain signal - Section 2.................................................................6

3.2

Frequency domain - Section 2...................................................................6

3.3

Time domain signal - Section 3.................................................................7

3.4

Frequency domain - Section 3...................................................................7

Mathlab Code.................................................................................................. 8

Discussion and conclusion.............................................................................10

List of figures
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure

1: Time domain signal plot..........................................................................1


2: Frequency domain plot............................................................................1
3: Time domain plot - Section 1..................................................................3
4: Frequency domain plot for section 1.......................................................4
5: Plot of time domain showing the last value above the set up threshold. 5
6: Section 2 Time domain signal.................................................................6
7: Section 2 Frequency domain...................................................................6
8: Section 3 Time domain signal.................................................................7
9: Section 3 Frequency domain...................................................................7
10: Frequency domain comparison plot....................................................10

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.

1.1 Time domain signal plot


The time domain plot shown below comes from 50 000 values recorded every
7

2 10

seconds during a period of 0.01 second (5MHz for 0.01s).

Section
1
Section
2

Section
3

Figure 1: Time domain signal plot

1.2 Frequency domain plot

Figure 2: Frequency domain plot

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.

Maximum values for section 1:


At point 297: y = -0.016652832
At point 659: y= 0.015085449
The highest value of these two figures (y=0.015085449) makes the upper and
lower (-y) threshold for section 1, progressing towards higher values of time, the
first value above this value is assumed to belong to the next section.
2

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)

2.2 The time domain plot Section 1

Figure 3: Time domain plot - Section 1

To plot the corresponding frequency domain the following Matlab command is


used:
[pyys1,f] = pwelch(ys1,[],[],4096,fs)
The function creates two variables:
yyys1 is the y values variable of power spectral density.
f is the generated frequency range
It can noticed that the options for this function are kept the same than in the
readlvsgl_MEng_2014.m code, the only changing input is ys1.
When creating the plot for the frequency domains, the two variables, pyys* and f
(where * is the section number) are reduced to value below 1x10 6 Hz, which
correspond to 821 values (was 2048). This helps to eliminate the insignificant
values for the frequency plot.

2.3 Frequency domain plot Section 1

Figure 4: Frequency domain plot for section 1

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.

3.1 Time domain signal - Section 2

Figure 6: Section 2 Time domain signal

3.2 Frequency domain - Section 2

Figure 7: Section 2 Frequency domain

3.3 Time domain signal - Section 3

Figure 8: Section 3 Time domain signal

3.4 Frequency domain - Section 3

Figure 9: Section 3 Frequency domain

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);

%Section 1 time and frequency domain plots


figure

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')

%Section 2 time and frequency domain plots


figure
plot(xs2,ys2)
xlabel('Time (s)')
ylabel('Ampliture (V)')
title('Time domain signal - Section 2')

[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')

%Section 3 time and frequency domain plots


figure
plot(xs3,ys3)
xlabel('Time (s)')
ylabel('Ampliture (V)')
title('Time domain signal - Section 3')

[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

5 Discussion and conclusion

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).

Figure 10: Frequency domain comparison plot

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

You might also like