praveen450
Member level 5
Hello,
I'm implementing a matlab code to find energy in the gaussian signal. First I generated a gaussian signal and find the energy in it. Again I differentiated the signal 5 times and find the energy in it. Now, the energy in both the gaussian and 5th derivative gaussian signal should be same. But I'm unable to get this answer. Could anyone help me in this regard.
The matlab code is shown below :
clc
clear
b2=0
c=0.1e-9;
a2=1
x1=linspace(-1,1,2000);
x=x1.*10.^-8;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
in1=exp(-((x)./c).^2);%zero-order gaussian signal
out=abs(in1.^2/50);%power of the signal
%energy =sum(out)%energy of the differentiated signal
energy=trapz(x,out)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%der2=-2*in1.*(c^2-2*x.^2)/(c^4);
der2=diff(in1,5)./(x(2)-x(1))^5;
der2=horzcat(der2,0,0,0,0,0)
out=abs(der2.^2/50);%power of the signal
%energy=sum(out)%energy of the differentiated signal
energy=trapz(x,out)
I'm implementing a matlab code to find energy in the gaussian signal. First I generated a gaussian signal and find the energy in it. Again I differentiated the signal 5 times and find the energy in it. Now, the energy in both the gaussian and 5th derivative gaussian signal should be same. But I'm unable to get this answer. Could anyone help me in this regard.
The matlab code is shown below :
clc
clear
b2=0
c=0.1e-9;
a2=1
x1=linspace(-1,1,2000);
x=x1.*10.^-8;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
in1=exp(-((x)./c).^2);%zero-order gaussian signal
out=abs(in1.^2/50);%power of the signal
%energy =sum(out)%energy of the differentiated signal
energy=trapz(x,out)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%der2=-2*in1.*(c^2-2*x.^2)/(c^4);
der2=diff(in1,5)./(x(2)-x(1))^5;
der2=horzcat(der2,0,0,0,0,0)
out=abs(der2.^2/50);%power of the signal
%energy=sum(out)%energy of the differentiated signal
energy=trapz(x,out)