You are on page 1of 12

Diskussion

Fraktionale Differentialgleichungen

Seite 20/31

(d) Using modified Fourier Series


The modification has been done as follows:
Firstly, the Fourier Series approximation of the original signal is solved using exactly
the previous method.
After that, the Fourier Series approximation was filtered to remove the extreme values. A threthold has been taken as follows:

v
u n
u1 X
RM SE = t
e2 ,
n

t=1

et = ReconstructedF unction OriginalF unction


If the individual error is larger than RM2SE , the time instant which causes the error
will be replaced with the coresponding time instant of the original signal.
After that, the filtered Fourier Series coefficients were again reconstructed from the
filtered signal and were used to find the required partial derivative using the Eq (1)
of the previous section.

Matlab Function:
1
2
3
4
5
6
7
8

10

11

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%INPUT
%----% - f : The required function. f must be defined for [t0,t0+T]
% - T
: period of the function
% - M
: number of frequencies (default: 50)
%-------------------------------------------------------------------------function .
[ReturnedValue1,ReturnedValue2,ReturnedValue6,ReturnedValue3,ReturnedValue4,
...
ReturnedValue7,ReturnedValue5] = .
Fractional_Derivative_Fourier_Series_Complete ...
(FunctionToBeDerivedInStringX, Beginning_Point, End_Point, .
RequiredDerivative)
%--------------------------------------------------------------------------

12
13
14
15
16
17
18
19
20
21
22

%-------------------------------------------------------------------------N = 100; % Number of points per period


M = 50; % Should be half of N
InputFunction = FunctionToBeDerivedInStringX;
t0 = Beginning_Point;
T = End_Point - Beginning_Point;
q = RequiredDerivative;
w0 = 2*pi/T;
t = linspace(t0,T,N);
%--------------------------------------------------------------------------

The code of this function was inspired/excerpted/modified by/from both Guilherme Coco fourier_coeff Beltramini and George Papazafeiropoulos fourier_diffint

Diskussion

Fraktionale Differentialgleichungen

Seite 21/31

23
24
25
26
27

%-------------------------------------------------------------------------%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Another Way %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


fun = inline(InputFunction,x);
U = fun(t);

28
29

A0_New = 1/T*quadl(fun,t0,t0+T);

30
31
32

coeff_New(2*M+1,1) = 0;
coeff_New(1) = A0_New;

% Initialization

33
34
35
36
37

f_aux = inline([( InputFunction ) .*cos(w0*m*x)],x,m,w0);


for m=1:M
coeff_New(m+1) = quadl(f_aux,t0,t0+T,[],[],m,w0);
end

38
39
40
41
42
43

f_aux = inline([( InputFunction ) .*sin(w0*m*x)],x,m,w0);


for m=1:M
coeff_New(m+M+1) = quadl(f_aux,t0,t0+T,[],[],m,w0);
end
coeff_New(2:end) = 2/T * coeff_New(2:end);

44
45

%--------------------------------------------------------------------------

46
47

%%%%%%%%%%%%%%% Reconstruct the Signal %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

48
49
50
51
52
53
54
55
56

Fourier_Series = zeros(N,2*M+1);
% Initialization
Fourier_Series(:,1) = 1;
for m=2:M+1
Fourier_Series(:,m) = cos(w0*(m-1)*t);
Fourier_Series(:,m+M) = sin(w0*(m-1)*t);
end
Function_Reconstructed = Fourier_Series*reshape(coeff_New,2*M+1,1);
ReturnedValue1 = Function_Reconstructed;

57
58
59
60

%-------------------------------------------------------------------------%%%%%%%%%%%%%%%%%%%%%% Perform filteration of extreme values %%%%%%%%%%%%%%


%--------------------------------------------------------------------------

61
62

Error_Method2 = sqrt(mean((Function_Reconstructed - U).^2));

63
64

ErrorVector_Method2 = zeros(1, length(t));

65
66

for i = 1 : length(t)

67

ErrorVector_Method2(i) = sqrt((Function_Reconstructed(i) - U(i)).^2);

68
69

end

70
71
72
73
74

Function_Reconstructed_filtered = Function_Reconstructed;
Indecies1 = find(ErrorVector_Method2 > Error_Method2/2);
Function_Reconstructed_filtered(Indecies1) = U(Indecies1);

75
76
77

Error_Method2_New = sqrt(mean((Function_Reconstructed_filtered - U).^2));


ReturnedValue2 = Error_Method2_New;

Diskussion

78

Fraktionale Differentialgleichungen

Seite 22/31

ReturnedValue6 = ErrorVector_Method2;

79
80
81
82

%-------------------------------------------------------------------------%%%%%%%%%%%% Recover Fourier Coefficients of Filtered Signal %%%%%%%%%%%%%%


%--------------------------------------------------------------------------

83
84

Fourier_Series_Method2 = Fourier_Series \ Function_Reconstructed_filtered;

85
86
87
88
89

A0_New_filtered = Fourier_Series_Method2(1);
An_New_filtered = Fourier_Series_Method2(2 : M+1);
Bn_New_filtered = Fourier_Series_Method2(M+2 : 2*M+1);
coeff_New_filtered = [A0_New_filtered ; An_New_filtered ; Bn_New_filtered];

90
91
92

%-------------------------------------------------------------------------%%%%%%%%%%%%%%%%%% Reconstruct filted signals %%%%%%%%%%%%%%%%%%%%%%%%%%%%%

93
94
95
96
97
98
99

Fourier_Series_filtered = zeros(N,2*M+1);
% Initialization
Fourier_Series_filtered(:,1) = 1;
for m=2:M+1
Fourier_Series_filtered(:,m) = cos(w0*(m-1)*t);
Fourier_Series_filtered(:,m+M) = sin(w0*(m-1)*t);
end

100
101

102

Function_Reconstructed_filtered_reconstruct = .
Fourier_Series_filtered*reshape(coeff_New_filtered,2*M+1,1);
ReturnedValue3 = Function_Reconstructed_filtered_reconstruct;

103
104

ErrorVector_Method_Reconstructed = zeros(1, length(t));

105
106

for i = 1 : length(t)

107

ErrorVector_Method_Reconstructed(i) = .
sqrt((Function_Reconstructed_filtered_reconstruct(i) - U(i)).^2);

108

109

end

110
111

112
113

Reconstruction_Error_Method2 = .
sqrt(mean((Function_Reconstructed_filtered_reconstruct - U).^2));
ReturnedValue4 = Reconstruction_Error_Method2;
ReturnedValue7 = ErrorVector_Method_Reconstructed;

114
115
116

%-------------------------------------------------------------------------%%%%%%%%%%%%%%%%%%%%% Calculate the Partial Derivative %%%%%%%%%%%%%%%%%%%%

117
118

A0_Fourier = A0_New_filtered/(gamma(1 - q) + eps);

119
120
121
122
123
124
125
126
127
128
129

n = length(An_New_filtered);
KK = (1:n) * w0;
ZZ = (q * pi)/2;
% replicate data appropriately
eval_t = t(:,ones(1,n));
eval_n = KK(:,ones(1,length(t)));
eval_An = An_New_filtered(:,ones(1,length(t)));
eval_Bn = Bn_New_filtered(:,ones(1,length(t)));

Diskussion

130
131

Fraktionale Differentialgleichungen

Seite 23/31

% differintegral
Y2_Der = A0_Fourier .* (t + eps).^(-q) + sum((eval_n + .
eps).^(q).*(eval_An.*cos(eval_n.*eval_t + ZZ) + eval_Bn.*sin(eval_n.*eval_t
+ ZZ)),2);

132
133
134

ReturnedValue5 = Y2_Der;
%--------------------------------------------------------------------------

Example (1): f(x) = sin(x)


1
2

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This example applies the modified Fourier Series and Then derives it

3
4
5
6
7
8
9
10
11
12

clear all;clc;
figure
t = linspace(0,2*pi,100);
InputFunction = sin(x);
fun = inline(InputFunction,x);
U = fun(t);
alphaX = -10 : 1 : 10;
cc = jet(length(alphaX));
N = 0;

13
14
15
16
17
18
19

20
21
22
23
24
25
26
27
28
29
30
31

for alpha = -10 : 1 : 10


[Y1,Error_Between_Filted_And_Original,Error_Filted_And_Original_Vector, ...
Y3,Error_Recons_Signal_After_Filterat_And_Original, ...
Error_Recons_Signal_After_Filterat_And_Original_Vector,Y5] = ...
Fractional_Derivative_Fourier_Series_Complete(InputFunction, 0, 2*pi, .
alpha/10);
if(length(Y5) == 1)
Y5(1:length(X)) = Y5(length(Y5));
else
%do nothing
end
if(alpha == -10 || alpha == 0 || alpha == 10)
N = 2.5;
else
N = 1.5;
end
plot(t,Y5,LineWidth,N,color,cc(alpha+11,:));hold on
end

32
33
34

set(gca,xTick,0:pi/2:2*pi)
set(gca,xTickLabel,{0,\pi/2,\pi,3\pi/2,2\pi})

35
36
37

38

xlabel(x,fontsize,14,Interpreter,latex);
ylabel($ y = d^{\alpha} f(x) / d .
x^{\alpha}$,fontsize,14,Interpreter,latex);
title(Fractional derivatives of $f(x) = sin(x)$ of order $\alpha = 0, 0.1,
..., 0.2, 1.0$,fontsize,14,Interpreter,latex)

39
40
41

h = legend($\alpha = -1$, $\alpha = -0.9$, $\alpha = -0.8$, $\alpha =

Diskussion

Fraktionale Differentialgleichungen

Seite 24/31

-0.7$, $\alpha = -0.6$, $\alpha = -0.5$, $\alpha = -0.4$, $\alpha =


-0.3$, $\alpha = -0.2$, $\alpha = -0.1$, ...
$\alpha = 0$, $\alpha = 0.1$, $\alpha = 0.2$, $\alpha = 0.3$, .
$\alpha = 0.4$, $\alpha = 0.5$, $\alpha = 0.6$, $\alpha = 0.7$,
$\alpha = 0.8$, $\alpha = 0.9$, $\alpha = 1$);
set(h,Interpreter,latex);grid on

42

43

44
45

46

47

text(1.57,-0.4,$y = .
cos(x)$,fontsize,14,color,cc(10+11,:),Interpreter,latex)
text(3.35,0.8,$y = .
-cos(x)$,fontsize,14,color,cc(-10+11,:),Interpreter,latex)
text(3.35,0.2,$y = .
sin(x)$,fontsize,14,color,cc(0+11,:),Interpreter,latex)

48
49
50
51
52
53
54
55

figure;
plot(t,U,LineWidth,2)
hold on
plot(t,Y3,r.,LineWidth,2)
grid on
set(gca,xTick,0:pi/2:2*pi)
set(gca,xTickLabel,{0,\pi/2,\pi,3\pi/2,2\pi})

56
57
58
59

60
61

xlabel(x,fontsize,14,Interpreter,latex);
ylabel($ y = sin(x)$,fontsize,14,Interpreter,latex);
title(Fourier Series approximation of $f(x) = sin(x)$, Extreme values are
filtered,fontsize,14,Interpreter,latex)
h2 = legend($Original$, $Approximation$);
set(h2,Interpreter,latex);

62
63
64
65
66
67

figure;
plot(t,Error_Filted_And_Original_Vector,LineWidth,2)
hold on
plot(t,Error_Recons_Signal_After_Filterat_And_Original_Vector,r.,LineWidth,2)
grid on

68
69
70
71

72
73

xlabel(x,fontsize,14,Interpreter,latex);
ylabel($\sqrt{\frac{1}{n}\sum_{t=1}^{n}e_t^2}$,fontsize,14,Interpreter,latex);
title(Root mean squared Error between Original signal and Fourier Series .
approximation,fontsize,14,Interpreter,latex)
h3 = legend($Before Filtration$, $After Filtration$);
set(h3,Interpreter,latex);

Fraktionale Differentialgleichungen

Diskussion

Fractional derivatives of f (x) = sin(x) of order = 1, 0.9, ..., 0.9, 1.0

1.5

y = d f (x)/dx

Seite 25/31

= 1
= 0.9
= 0.8
= 0.7
= 0.6
= 0.5
= 0.4
= 0.3
= 0.2
= 0.1
=0
= 0.1
= 0.2
= 0.3
= 0.4
= 0.5
= 0.6
= 0.7
= 0.8
= 0.9
=1

y = cos(x)

0.5

y = sin(x)
0

0.5

y = cos(x)
1

1.5

3
2

Abbildung 7: Fractional Derivative Calculation using modified Fourier Series. Very powerful method, works for all R. Works perfectly for periodic functions, however, within non periodic
functions Gibbs phenomenon will make the result little poor!
Fourier Series approximation of f (x) = sin(x), Extreme values are filtered

Root mean
squared Error between Original signal and Fourier Series approximation
109
1.8

1
Original
Fourier Series Approximation

0.8

Before Filtration
After Filtration

1.6

0.6
1.4

0.4
2
t=1 et

0.8

q P
n
1

y = sin(x)

1.2

0.2
0
0.2

0.6

0.4
0.4

0.6
0.2

0.8
1

3
2

3
2

Abbildung 8: Modified Fourier Series approximation of f (x) = sin(x) where the extreme values
are filtered based on Root Mean Squared Error threshold.

Fraktionale Differentialgleichungen

Diskussion

Seite 26/31

Example (2): f(x) = x*(x pi)*(x 2*pi)


1
2

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This example applies the modified Fourier Series and Then derives it

3
4
5
6
7
8
9
10
11
12

clear all;clc;
figure
t = linspace(0,2*pi,100);
InputFunction = x.*(x - pi).*(x - 2*pi);
fun = inline(InputFunction,x);
U = fun(t);
alphaX = -10 : 1 : 10;
cc = jet(length(alphaX));
N = 0;

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

%%
for alpha = -10 : 1 : 10
[Y1,Error_Between_Filted_And_Original,Error_Filted_And_Original_Vector, ...
Y3,Error_Recons_Signal_After_Filterat_And_Original, ...
Error_Recons_Signal_After_Filterat_And_Original_Vector,Y5, ...
Threshold] = Fractional_Derivative_Fourier_Series_Complete ...
(InputFunction, 0, 2*pi, alpha/10);
if(length(Y5) == 1)
Y5(1:length(t)) = Y5(length(Y5));
else
%do nothing
end
if(alpha == -10 || alpha == 0 || alpha == 10)
N = 2.5;
else
N = 1.5;
end
plot(t,Y5,LineWidth,N,color,cc(alpha+11,:));hold on
end
%%
set(gca,xTick,0:pi/2:2*pi)
set(gca,xTickLabel,{0,\pi/2,\pi,3\pi/2,2\pi})

36
37
38
39
40

xlabel(x,fontsize,14,Interpreter,latex);
ylabel($ y = d^{\alpha} f(x) / d x^{\alpha}$,fontsize,14,Interpreter, ...
latex);
title(Fractional derivatives of $f(x) = x*(x - pi)*(x - 2*pi)$ of order .
$\alpha = -1, -0.9, ..., 0.9, 1.0$,fontsize,14,Interpreter,latex)

41
42
43

44

45

h = legend($\alpha = -1$, $\alpha = -0.9$, $\alpha = -0.8$, $\alpha =


-0.7$, $\alpha = -0.6$, $\alpha = -0.5$, $\alpha = -0.4$, $\alpha =
-0.3$, $\alpha = -0.2$, $\alpha = -0.1$, ...
$\alpha = 0$, $\alpha = 0.1$, $\alpha = 0.2$, $\alpha = 0.3$, .
$\alpha = 0.4$, $\alpha = 0.5$, $\alpha = 0.6$, $\alpha = 0.7$,
$\alpha = 0.8$, $\alpha = 0.9$, $\alpha = 1$);
set(h,Interpreter,latex);grid on

46
47

% text(1.57,-0.4,$y =

.
.

Diskussion

Fraktionale Differentialgleichungen

Seite 27/31

cos(x)$,fontsize,14,color,cc(10+11,:),Interpreter,latex)
% text(3.35,0.8,$y = .
-cos(x)$,fontsize,14,color,cc(-10+11,:),Interpreter,latex)
% text(3.35,0.2,$y = .
sin(x)$,fontsize,14,color,cc(0+11,:),Interpreter,latex)

48

49

50
51
52
53
54
55
56
57

figure;
plot(t,U,LineWidth,1.5)
hold on
plot(t,Y3,r.,LineWidth,1)
grid on
set(gca,xTick,0:pi/2:2*pi)
set(gca,xTickLabel,{0,\pi/2,\pi,3\pi/2,2\pi})

58
59
60
61

62
63

xlabel(x,fontsize,14,Interpreter,latex);
ylabel($ f(x) = x*(x - pi)*(x - 2*pi)$,fontsize,14,Interpreter,latex);
title(Fourier Series approximation. Extreme values are .
filtered,fontsize,14,Interpreter,latex)
h2 = legend($Original$, $Approximation$);
set(h2,Interpreter,latex);

64
65
66
67
68
69
70
71

figure;
plot(t,Error_Filted_And_Original_Vector,LineWidth,1.5)
hold on
plot(t,Error_Recons_Signal_After_Filterat_And_Original_Vector,r.,LineWidth,1)
hold on
Threshold(1:length(t)) = Threshold(length(Threshold));
plot(t,Threshold,g-,LineWidth,1);grid on

72
73
74
75

76
77

1
2
3
4

xlabel(x,fontsize,14,Interpreter,latex);
ylabel($\sqrt{\frac{1}{n}\sum_{t=1}^{n}e_t^2}$,fontsize,14,Interpreter,latex);
title(Root mean squared Error between Original signal and Fourier Series .
approximation,fontsize,14,Interpreter,latex)
h3 = legend($Before Filtration$, $After Filtration$);
set(h3,Interpreter,latex);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
syms x;
Y = x.*(x - pi).*(x - 2*pi);
t = linspace(0,2*pi,100); % As defined in the fractional calculus function

5
6
7
8

%------ alpha = 0, 0th fractional derivative -----------------------------U = subs(Y,x,t);


plot(t,U,b.); hold on

9
10
11
12
13

%------ alpha = 1, 1st fractional derivative / normal derivative ---------R = diff(Y,x);


R_X = subs(R,x,t);
plot(t,R_X,b.); hold on

14
15
16
17
18

%----- alpha = -1, -1st fractional derivative / normal integration -------RR = int(Y,x);
RR_X = subs(RR,x,t);
plot(t,RR_X,r.); grid on

Fraktionale Differentialgleichungen

Diskussion

Seite 28/31

Fractional derivatives of f (x) = x (x pi) (x 2 pi) of order = 1, 0.9, ..., 0.9, 1.0
25

= 1
= 0.9
= 0.8
= 0.7
= 0.6
= 0.5
= 0.4
= 0.3
= 0.2
= 0.1
=0
= 0.1
= 0.2
= 0.3
= 0.4
= 0.5
= 0.6
= 0.7
= 0.8
= 0.9
=1

20

Seems to be
shifted above!

y = d f (x)/dx

15

10

0
5
10
15

3
2

Abbildung 9: Fractional Derivative Calculation using modified Fourier Series.


Fourier Series approximation. Extreme values are filtered

Root mean
squared Error between Original signal and Fourier Series approximation
103
1

15
Original
Fourier Series Approximation

Before Filtration
After Filtration
Threshold

10
0.8
0.7
2
t=1 et

0.6

q P
n
1

0.5

f (x) = x (x pi) (x 2 pi)

0.9

0.4

0.3
0.2

10

15

0.1
0

3
2

3
2

Abbildung 10: Modified Fourier Series approximation of f (x) = x (x pi) (x 2 pi) where
the extreme values are filtered based on Root Mean Squared Error threshold.

Diskussion

Fraktionale Differentialgleichungen

Seite 29/31

Example (3): f(x) = x


1
2

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% My Fourier Series Function With Enhancement & Filteration %%%%%%%

3
4

% This example applies the modified Fourier Series and Then derives it

5
6
7
8
9
10
11
12
13
14
15

tic
clear all;clc;
figure
t = linspace(0,2*pi,100);
InputFunction = x;
fun = inline(InputFunction,x);
U = fun(t);
alphaX = -10 : 1 : 10;
cc = jet(length(alphaX));
N = 0;

16
17
18
19
20
21
22
23

%%
for alpha = -10 : 1 : 10
[Y1,Error_Between_Filted_And_Original,Error_Filted_And_Original_Vector, ...
Y3,Error_Recons_Signal_After_Filterat_And_Original, ...
Error_Recons_Signal_After_Filterat_And_Original_Vector,Y5, ...
Threshold] = Fractional_Derivative_Fourier_Series_Complete ...
(InputFunction, 0, 2*pi, alpha/10);

24

if(length(Y5) == 1)
Y5(1:length(t)) = Y5(length(Y5));
else
%do nothing
end
if(alpha == -10 || alpha == 0 || alpha == 10)
N = 2.5;
else
N = 1.5;
end
plot(t,Y5,LineWidth,N,color,cc(alpha+11,:));hold on

25
26
27
28
29
30
31
32
33
34
35
36
37

end
%%

38
39
40

set(gca,xTick,0:pi/2:2*pi)
set(gca,xTickLabel,{0,\pi/2,\pi,3\pi/2,2\pi})

41
42
43

44

xlabel(x,fontsize,14,Interpreter,latex);
ylabel($ y = d^{\alpha} f(x) / d .
x^{\alpha}$,fontsize,14,Interpreter,latex);
title(Fractional derivatives of $f(x) = x$ of order $\alpha = -1, -0.9, ...,
0.9, 1.0$,fontsize,14,Interpreter,latex)

45
46
47

48

h = legend($\alpha = -1$, $\alpha = -0.9$, $\alpha = -0.8$, $\alpha =


-0.7$, $\alpha = -0.6$, $\alpha = -0.5$, $\alpha = -0.4$, $\alpha =
-0.3$, $\alpha = -0.2$, $\alpha = -0.1$, ...
$\alpha = 0$, $\alpha = 0.1$, $\alpha = 0.2$, $\alpha = 0.3$, .

.
.

Diskussion

Fraktionale Differentialgleichungen

Seite 30/31

$\alpha = 0.4$, $\alpha = 0.5$, $\alpha = 0.6$, $\alpha = 0.7$,


$\alpha = 0.8$, $\alpha = 0.9$, $\alpha = 1$);
set(h,Interpreter,latex);grid on

49
50
51

% text(1.57,-0.4,$y = .
cos(x)$,fontsize,14,color,cc(10+11,:),Interpreter,latex)
% text(3.35,0.8,$y = .
-cos(x)$,fontsize,14,color,cc(-10+11,:),Interpreter,latex)
% text(3.35,0.2,$y = .
sin(x)$,fontsize,14,color,cc(0+11,:),Interpreter,latex)

52

53

54
55
56
57
58
59
60
61

figure;
plot(t,U,LineWidth,1.5)
hold on
plot(t,Y3,r.,LineWidth,1)
grid on
set(gca,xTick,0:pi/2:2*pi)
set(gca,xTickLabel,{0,\pi/2,\pi,3\pi/2,2\pi})

62
63
64
65

66
67

xlabel(x,fontsize,14,Interpreter,latex);
ylabel($ f(x) = x$,fontsize,14,Interpreter,latex);
title(Fourier Series approximation. Extreme values are .
filtered,fontsize,14,Interpreter,latex)
h2 = legend($Original$, $Approximation$);
set(h2,Interpreter,latex);

68
69
70
71
72
73
74
75

figure;
plot(t,Error_Filted_And_Original_Vector,LineWidth,1.5)
hold on
plot(t,Error_Recons_Signal_After_Filterat_And_Original_Vector,r.,LineWidth,1)
hold on
Threshold(1:length(t)) = Threshold(length(Threshold));
plot(t,Threshold,g-,LineWidth,1);grid on

76
77
78
79

80
81
82

xlabel(x,fontsize,14,Interpreter,latex);
ylabel($\sqrt{\frac{1}{n}\sum_{t=1}^{n}e_t^2}$,fontsize,14,Interpreter,latex);
title(Root mean squared Error between Original signal and Fourier Series .
approximation,fontsize,14,Interpreter,latex)
h3 = legend($Before Filtration$, $After Filtration$);
set(h3,Interpreter,latex);
toc

Fraktionale Differentialgleichungen

Diskussion

Seite 31/31

Fractional derivatives of f (x) = x of order = 1, 0.9, ..., 0.9, 1.0

25

= 1
= 0.9
= 0.8
= 0.7
= 0.6
= 0.5
= 0.4
= 0.3
= 0.2
= 0.1
=0
= 0.1
= 0.2
= 0.3
= 0.4
= 0.5
= 0.6
= 0.7
= 0.8
= 0.9
=1

20

y = d f (x)/dx

15

10

0
5
10
15

3
2

Abbildung 11: Fractional Derivative Calculation using modified Fourier Series. Modification still
does not work as required!

Fourier Series approximation. Extreme values are filtered

Root mean squared Error between Original signal and Fourier Series approximation
3.5

7
Original
Approximation

Before Filtration
After Filtration

1.5

0.5

2
t=1 et

2.5

q P
n
1

f (x) = x

3
2

3
2

Abbildung 12: Modified Fourier Series approximation of f (x) = x where the extreme values are
filtered based on Root Mean Squared Error threshold.

You might also like