-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfwdmodel.f90
More file actions
51 lines (36 loc) · 1.11 KB
/
Copy pathfwdmodel.f90
File metadata and controls
51 lines (36 loc) · 1.11 KB
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
module fwdmodel
use comm,only: J,wp,c_int,pi,c
implicit none
private
public:: chirp, chirp_phase
contains
pure subroutine chirp(bm,tm,t,Ns,range_m,Atarg,Ntarg,nlfm,y)
integer(c_int), intent(in) :: Ns,Ntarg
real(wp), intent(in) :: bm,tm,t(Ns),range_m(Ntarg),Atarg(Ntarg),nlfm
complex(wp),intent(out) :: y(Ns)
complex(wp) :: LO(Ns)
real(wp) :: phase(Ns), toffs(Ntarg)
integer :: i
toffs = 2*range_m/c !two-way delay
call chirp_phase(bm,tm,t,Ns,nlfm,phase)
! radar transmit
LO = exp(J*phase)
! generate target returns
y = 0.
do concurrent (i=1:Ntarg)
call chirp_phase(bm,tm,t+toffs(i),Ns,nlfm,phase)
y = y + Atarg(i) * exp(J*phase) * conjg(LO)
enddo
end subroutine chirp
pure subroutine chirp_phase(bm,tm,t,Ns,nlfm,phase)
integer(c_int), intent(in) :: Ns
real(wp), intent(in) :: bm,tm,nlfm,t(Ns)
real(wp), intent(out):: phase(Ns)
real(wp) :: B1, B2
B1 = bm / tm
B2 = bm / tm**2
phase = 2._wp*pi*(-0.5_wp*bm*t & !starting freq
+ 0.5_wp*B1*t**2 & !linear ramp ("derivative of phase is frequency")
+ 0.5_wp*nlfm*B2*t**3) !quadratic frequency
end subroutine chirp_phase
end module fwdmodel