-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExampleFD.m
75 lines (60 loc) · 1.7 KB
/
ExampleFD.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
%ExampleFD.m sample program
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% FREQUENCY RESPONSE %
% by E. Amador (emmanuel.amador@insa-rennes.fr) %
% IETR/DGA %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear
global f c Rf POS va
%dimensions
l=8.7;
p=3.7;
h=2.9;
tic
c = 299792458;%
Lt = 1e-6; %Time-window length in seconds
nbre_elements = 1; %number of radiating elements
%loading the Position matrix from the image generator
filename = sprintf('%delem_%dns1s8.mat',nbre_elements,round(Lt/(1e-9)));
load(filename)
f=1e6:1e6:150e6;
%Loss coefficient
Rf = 0.998*ones(1,length(f)); %the loss coefficient Rf can be a function of the frequency
% %if a measurement of the quality factor is available Q(fq), use:
% f=fq(1):1e6:fq(end);
% Qi=interp1(fq,Q,f);
% L=2*(l*p*h)/(lp+lh+ph); %reverberation distance
% Rf=exp(-L*f.*2*pi./(2*c*Qf));
va=0*ones(1,length(f)); %volumetric absorption due to air absorption
%Reception point rectangular coordinates
X_1 = 4.5;
Y_1 = 3;
Z_1 = 1.5;
tic
[Ex,Ey,Ez] = FR(X_1,Y_1,Z_1);
toc
%Frequency response figure
figure(1)
subplot(3,1,1)
plot(f/1e6,20*log10(abs(Ex)))
title('FFT_x')
xlim([0 max(f)/1e6])
grid on
xlabel('frequency in MHz')
ylabel('dB')
subplot(3,1,2)
plot(f/1e6,20*log10(abs(Ey)))
title('FFT_y')
xlim([0 max(f)/1e6])
grid on
xlabel('frequency in MHz')
ylabel('dB')
subplot(3,1,3)
plot(f/1e6,20*log10(abs(Ez)))
title('FFT_z')
xlim([0 max(f)/1e6])
grid on
xlabel('frequency in MHz')
ylabel('dB')