-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimChirp.py
More file actions
executable file
·33 lines (25 loc) · 697 Bytes
/
Copy pathSimChirp.py
File metadata and controls
executable file
·33 lines (25 loc) · 697 Bytes
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
#!/usr/bin/env python
"""
Simulates chirp transmission without noise
"""
from numpy import arange
from matplotlib.pyplot import figure, show
#
from tincanradar.fwdmodel import chirptx
bm = 0.3e6 # Hz
tm = 0.1 # s
tfs = 1e6 # Hz #for sim only
t = arange(0, tm, 1 / tfs)
# %% raw chirp waveform centered at IF frequency (here, it's 0)
sig = chirptx(bm, tm, t, nlfm=0.0)
# %% Plot power spectral density (PSD)
# f, t, Sxx = spectrogram(sig, tfs)
# ax.pcolormesh(t, f, Sxx)
fg = figure()
ax = fg.gca()
hi = ax.specgram(sig, Fs=tfs, vmin=-100)[-1]
ax.set_ylabel("Frequency [Hz]")
ax.set_xlabel("Time [sec]")
ax.set_title("Chirp PSD (centered on LO frequency)")
fg.colorbar(hi, ax=ax)
show()