Skip to content

Commit

Permalink
started modeling object reflection dynamics
Browse files Browse the repository at this point in the history
  • Loading branch information
ugeorge committed Dec 10, 2019
1 parent c95025a commit 7974c39
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 6 deletions.
6 changes: 4 additions & 2 deletions aesa-atom/src/AESA/Params.lhs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### System Parameters {#sec:aesa-parameters label="AESA parameters"}

Here we define the size constants, for a simple test scenario provided by Saab AB. The
Here we define the size constants, for a simple test scenario. The
size `nA` can be inferred from the size of input data and the vector operations.

> module AESA.Params where
Expand All @@ -14,5 +14,7 @@ size `nA` can be inferred from the size of input data and the vector operations.
>
> freqRadar = 10e9 :: Float -- 10 Ghz X-band
> waveLength = 3e8 / freqRadar
> dElements = waveLength/2
> dElements = waveLength / 2
> fSampling = 3e6 :: Float
> pulseWidth = 1e-6 :: Float

54 changes: 54 additions & 0 deletions aesa-atom/src/AESA/Radar.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{-# LANGUAGE PackageImports #-} --can be ignored
module AESA.Radar where

import ForSyDe.Atom.MoC.CT as CT
import "forsyde-atom-extensions" ForSyDe.Atom.Skeleton.Vector as V

import qualified ForSyDe.Atom.MoC.TimeStamp as Ts
import qualified ForSyDe.Atom.MoC.Time as T

import AESA.Params
import Data.Complex-- SignalPower given as relative to the full scale power

objectReflection :: Float -> Float -> Float -> Float -> Integer
-> Vector (CT.Signal (Complex Float))
objectReflection radix d a r s
= V.farm11 (CT.infinite1 . generateObjectReflection radix d a r s) (vector [1..nA])

-- radix is a random number in (0,359)
-- Distance in meters
-- Relative speed in m/s, positive relative speed means approaching object
-- Angle to object, given as Theta above
generateObjectReflection :: Float -> Float -> Float -> Float -> Integer
-> Int -> T.Time -> Complex Float
generateObjectReflection radix distance angle relativeSpeed signalPower chanIx t
| range_bin >= trefl_start && range_bin <= trefl_stop && not crossing_reflection = value
| crossing_reflection = value
| otherwise = 0

where
i' = realToFrac chanIx
t' = realToFrac t
-- wd is 2*pi*doppler frequency
wd = 2 * pi * relativeSpeed / waveLength

-- A is the power of the reflected signal (-5 => 1/32 of fullscale)
bigA = 2 ^ signalPower

-- Large distances will fold to lower ones, assume infinite sequences
-- Otherwise the the first X pulses would be absent
trefl_start = ceiling (2 * distance / 3e8 * fSampling) `mod` nb
trefl_stop = ceiling (2 * distance / 3e8 + pulseWidth * fSampling) `mod` nb
range_bin = ceiling (t' * fSampling) `mod` nb

-- Handling for distances at the edge of the
crossing_reflection = trefl_stop < trefl_start

-- The initial phase of a full data cube will be random
phi_start = 2 * pi * radix / 360

-- channelDelay :: Integer -> Double
channelDelay = (-1) * i' * pi * sin angle
bigI = bigA * cos (wd * t' + phi_start)
bigQ = (-1) * bigA * sin (wd * t' + phi_start)
value = (bigI :+ bigQ) * (cos channelDelay :+ sin channelDelay)
Binary file added docs/figs_src/by-sa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions docs/template/html.template
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ $endif$
$endfor$
-->
$if(author)$
$if(copyright-notice)$
<div class="copyright-notice">$copyright-notice$</p>
$endif$
$for(author)$
$if(author.name)$
<p class="author">$author.name$ $if(author.email)$ <code>&lt;$author.email$&gt;</code>$endif$</p>
$if(author.affiliation)$ <p class="institute">$author.affiliation$</p>$endif$
<p class="author">$author.name$ $if(author.affiliation)$ <small>($author.affiliation$)</small>$endif$</p>
$else$
<p class="author">$author$</p>
$endif$
$sep$ \and
$sep$
$endfor$
$endif$

Expand All @@ -76,6 +78,8 @@ $if(abstract)$
<p class="abstract">$abstract$</p>
$endif$



</header>
$endif$
$if(toc)$
Expand Down
2 changes: 2 additions & 0 deletions docs/text/00_Intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ link-citations: true
linkReferences: true
abstract: |
This document serves as a report and as a step-by-step tutorial for modeling, simulating, testing and synthesizing complex heterogeneous systems in ForSyDe, with special focus on parallel and concurrent systems. The application under test is a radar signal processing chain for an active electronically scanned array (AESA) antenna provided by Saab AB. Throughout this report the application will be modeled using several different frameworks, gradually introducing new modeling concepts and pointing out similarities and differences between them.
copyright-notice: |
<a href="https://creativecommons.org/licenses/by-sa/4.0/"><img src="figs/by-sa.png" alt="CC-BY SA 4.0" width="80px"/></href></a>
header-includes: |
\usepackage{pdflscape}
\usepackage{todonotes}
Expand Down
4 changes: 3 additions & 1 deletion docs/text/99_Outro.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Acknowledgements

The authors would like to acknowledge Per Ericsson for his contributions in designing the AESA signal processing chain (in @fig:video-chain-spec) and in writing the specifications.
The authors would like to acknowledge Per Ericsson for his contributions in designing the AESA signal processing chain (in @fig:video-chain-spec) and in writing the specifications.

This report was partially funded by the Swedish Governmental Agency for Innovation Systems, NFFP7 project: Correct-by-construction design methodology #2017-04892.

[`ForSyDe.Atom.Skeleton.Vector`]: https://forsyde.github.io/forsyde-atom/api/ForSyDe-Atom-Skeleton-Vector.html
[`ForSyDe.Atom.MoC.SY`]: https://forsyde.github.io/forsyde-atom/api/ForSyDe-Atom-MoC-SY.html
Expand Down

0 comments on commit 7974c39

Please sign in to comment.