Skip to content

Commit dcc76bc

Browse files
committed
add mixed signal
1 parent 9dff3c3 commit dcc76bc

File tree

7 files changed

+203
-67
lines changed

7 files changed

+203
-67
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ Check [examples](https://github.com/zhiim/doa_py/tree/master/examples) for more
8484
- **Broadband**
8585
- _ChirpSignal_: Chirp signals with different chirp bandwidths within the sampling period.
8686
- _MultiFreqSignal_: Broadband signals formed by the superposition of multiple single-frequency signals within a certain frequency band.
87+
- _MixedSignal_: Narrorband and broadband mixed signal
8788

8889
### Algorithms
8990

doa_py/__init__.py

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
# DOA_py
2+
# DOA_Py
33
44
DOA Estimation algorithms implemented in Python. It can be used for ULA, UCA and
55
broadband/wideband DOA estimation.
@@ -65,7 +65,8 @@
6565
You will a get a figure like this:
6666
![music_spectrum](https://github.com/zhiim/doa_py/blob/master/pics/music_spectrum.svg)
6767
68-
Check `examples` for more examples.
68+
Check [examples](https://github.com/zhiim/doa_py/tree/master/examples) for more
69+
examples.
6970
7071
## What's implemented
7172
@@ -77,16 +78,17 @@
7778
7879
### Signal Models
7980
80-
- Narrowband
81-
**ComplexStochasticSignal**: The amplitude of signals at each sampling point
82-
is a complex random variable.
83-
**RandomFreqSignal**: Signals transmitted by different sources have different
84-
intermediate frequencies (IF).
85-
- Broadband
86-
**ChirpSignal**: Chirp signals with different chirp bandwidths within the
87-
sampling period.
88-
**MultiFreqSignal**: Broadband signals formed by the superposition of multiple
89-
single-frequency signals within a certain frequency band.
81+
- **Narrowband**
82+
- _ComplexStochasticSignal_: The amplitude of signals at each sampling point
83+
is a complex random variable.
84+
- _RandomFreqSignal_: Signals transmitted by different sources have different
85+
intermediate frequencies (IF).
86+
- **Broadband**
87+
- _ChirpSignal_: Chirp signals with different chirp bandwidths within the
88+
sampling period.
89+
- _MultiFreqSignal_: Broadband signals formed by the superposition of multiple
90+
single-frequency signals within a certain frequency band.
91+
- _MixedSignal_: Narrorband and broadband mixed signal
9092
9193
### Algorithms
9294
@@ -109,9 +111,9 @@
109111
110112
## License
111113
112-
This project is licensed under the [MIT](LICENSE) License - see the LICENSE
113-
file for details.
114+
This project is licensed under the [MIT](LICENSE) License - see the LICENSE file
115+
for details.
114116
"""
115117

116-
__version__ = "0.2.3"
118+
__version__ = "0.3.0"
117119
__author__ = "Qian Xu"

doa_py/arrays.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@ def received_signal(
9393
snr=None,
9494
nsamples=100,
9595
amp=None,
96-
min_length_ratio=0.1,
97-
no_overlap=False,
9896
unit="deg",
97+
**kwargs,
9998
):
10099
"""Generate array received signal based on array signal model
101100
@@ -112,12 +111,10 @@ def received_signal(
112111
snr: Signal-to-noise ratio. If set to None, no noise will be added
113112
nsamples (int): Number of snapshots, defaults to 100
114113
amp: The amplitude of each signal, 1d numpy array
115-
min_length_ratio (float): Minimum length ratio of the frequency
116-
range in (f_max - f_min)
117-
no_overlap (bool): If True, generate signals with non-overlapping
118-
subbands
119114
unit: The unit of the angle, `rad` represents radian,
120115
`deg` represents degree. Defaults to 'deg'.
116+
**kwargs: Additional parameters for generating broadband signal,
117+
check `gen` method of `BroadSignal`.
121118
"""
122119
# Convert the angle from degree to radians
123120
angle_incidence = self._unify_unit(angle_incidence, unit)
@@ -129,8 +126,7 @@ def received_signal(
129126
nsamples,
130127
angle_incidence,
131128
amp,
132-
min_length_ratio,
133-
no_overlap,
129+
**kwargs,
134130
)
135131
if isinstance(signal, NarrowSignal):
136132
received = self._gen_narrowband(
@@ -171,8 +167,7 @@ def _gen_broadband(
171167
nsamples,
172168
angle_incidence,
173169
amp,
174-
min_length_ratio=0.1,
175-
no_overlap=False,
170+
**kwargs,
176171
):
177172
"""Generate broadband received signal
178173
@@ -188,9 +183,8 @@ def _gen_broadband(
188183
incidence_signal = signal.gen(
189184
n=num_signal,
190185
nsamples=nsamples,
191-
min_length_ratio=min_length_ratio,
192-
no_overlap=no_overlap,
193186
amp=amp,
187+
**kwargs,
194188
)
195189

196190
# generate array signal in frequency domain

doa_py/plot.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -200,25 +200,10 @@ def plot_spatial_spectrum_2d(
200200
def plot_estimated_value_2d(
201201
estimated_azimuth,
202202
estimated_elevation,
203-
num_signal,
204203
ground_truth=None,
205204
unit="deg",
206-
x_label="Angle",
207-
y_label="Spectrum",
208205
):
209-
"""Display estimated angle values
210-
211-
Args:
212-
estimates: Angle estimates
213-
num_signal: Number of signals
214-
ground_truth: True incident angles
215-
ticks_min (int, optional): Minimum value for x-axis ticks.
216-
Defaults to -90.
217-
ticks_max (int, optional): Maximum value for x-axis ticks.
218-
Defaults to 90.
219-
x_label (str, optional): x-axis label. Defaults to "Angle".
220-
y_label (str, optional): y-axis label. Defaults to "Spetrum".
221-
"""
206+
"""Display estimated angle values"""
222207
if unit == "deg":
223208
estimated_azimuth = estimated_azimuth / 180 * np.pi
224209

0 commit comments

Comments
 (0)