Skip to content

Commit 0f44dde

Browse files
iqgen: added group delay simulation support
Added group delay simulation support. New parameter: '--group-delays <bool>'
1 parent db4eb28 commit 0f44dde

File tree

6 files changed

+380
-206
lines changed

6 files changed

+380
-206
lines changed

peregrine/iqgen/bits/satellite_base.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def setDoppler(self, doppler):
6262
'''
6363
self.doppler = doppler
6464

65-
def getSvName(self):
65+
def getName(self):
6666
'''
6767
Returns satellite name.
6868
@@ -101,7 +101,13 @@ def __str__(self):
101101
def __repr__(self):
102102
return self.getSvName()
103103

104-
def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams):
104+
def getBatchSignals(self,
105+
userTimeAll_s,
106+
samples,
107+
outputConfig,
108+
noiseParams,
109+
band,
110+
debug):
105111
'''
106112
Generates signal samples.
107113
@@ -113,6 +119,12 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams):
113119
Array to which samples are added.
114120
outputConfig : object
115121
Output configuration object.
122+
noiseParams : NoiseParameters
123+
Noise parameters object.
124+
band : Band
125+
Band description object.
126+
debug : bool
127+
Debug flag
116128
117129
Returns
118130
-------
@@ -121,14 +133,14 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams):
121133
'''
122134
raise NotImplementedError()
123135

124-
def isBandEnabled(self, bandIndex, outputConfig):
136+
def isBandEnabled(self, band, outputConfig):
125137
'''
126138
Checks if particular band is supported and enabled.
127139
128140
Parameters
129141
----------
130-
bandIndex : int
131-
Signal band index
142+
band : Band
143+
Band description object.
132144
outputConfig : object
133145
Output configuration
134146

peregrine/iqgen/bits/satellite_glo.py

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,13 @@ def getL2Message(self):
137137
'''
138138
return self.l1Message
139139

140-
def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, debug):
140+
def getBatchSignals(self,
141+
userTimeAll_s,
142+
samples,
143+
outputConfig,
144+
noiseParams,
145+
band,
146+
debug):
141147
'''
142148
Generates signal samples.
143149
@@ -149,6 +155,10 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, deb
149155
Array to which samples are added.
150156
outputConfig : object
151157
Output configuration object.
158+
noiseParams : NoiseParameters
159+
Noise parameters object
160+
band : Band
161+
Band description object.
152162
debug : bool
153163
Debug flag
154164
@@ -158,10 +168,8 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, deb
158168
Debug information
159169
'''
160170
result = []
161-
if (self.l1Enabled):
162-
band = outputConfig.GLONASS.L1
171+
if (self.l1Enabled and band == outputConfig.GLONASS.L1):
163172
intermediateFrequency_hz = band.INTERMEDIATE_FREQUENCIES_HZ[self.prn]
164-
frequencyIndex = band.INDEX
165173
values = self.doppler.computeBatch(userTimeAll_s,
166174
self.amplitude,
167175
noiseParams,
@@ -171,15 +179,13 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, deb
171179
self.caCode,
172180
outputConfig,
173181
debug)
174-
numpy.add(samples[frequencyIndex],
182+
numpy.add(samples[band.INDEX],
175183
values[0],
176-
out=samples[frequencyIndex])
184+
out=samples[band.INDEX])
177185
debugData = {'type': "GLOL1", 'doppler': values[1]}
178186
result.append(debugData)
179-
if (self.l2Enabled):
180-
band = outputConfig.GLONASS.L2
187+
if (self.l2Enabled and band == outputConfig.GLONASS.L2):
181188
intermediateFrequency_hz = band.INTERMEDIATE_FREQUENCIES_HZ[self.prn]
182-
frequencyIndex = band.INDEX
183189
values = self.doppler.computeBatch(userTimeAll_s,
184190
self.amplitude,
185191
noiseParams,
@@ -189,21 +195,21 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, deb
189195
self.caCode,
190196
outputConfig,
191197
debug)
192-
numpy.add(samples[frequencyIndex],
198+
numpy.add(samples[band.INDEX],
193199
values[0],
194-
out=samples[frequencyIndex])
200+
out=samples[band.INDEX])
195201
debugData = {'type': "GLOL2", 'doppler': values[1]}
196202
result.append(debugData)
197203
return result
198204

199-
def isBandEnabled(self, bandIndex, outputConfig):
205+
def isBandEnabled(self, band, outputConfig):
200206
'''
201207
Checks if particular band is supported and enabled.
202208
203209
Parameters
204210
----------
205-
bandIndex : int
206-
Signal band index
211+
band : Band
212+
Band description object.
207213
outputConfig : object
208214
Output configuration
209215
@@ -212,9 +218,9 @@ def isBandEnabled(self, bandIndex, outputConfig):
212218
True, if the band is supported and enabled; False otherwise.
213219
'''
214220
result = None
215-
if bandIndex == outputConfig.GLONASS.L1.INDEX:
221+
if band == outputConfig.GLONASS.L1:
216222
result = self.isL1Enabled()
217-
elif bandIndex == outputConfig.GLONASS.L2.INDEX:
223+
elif band == outputConfig.GLONASS.L2:
218224
result = self.isL2Enabled()
219225
else:
220226
result = False

peregrine/iqgen/bits/satellite_gps.py

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,13 @@ def getL2CMessage(self):
147147
'''
148148
return self.l2cMessage
149149

150-
def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, debug):
150+
def getBatchSignals(self,
151+
userTimeAll_s,
152+
samples,
153+
outputConfig,
154+
noiseParams,
155+
band,
156+
debug):
151157
'''
152158
Generates signal samples.
153159
@@ -159,6 +165,10 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, deb
159165
Array to which samples are added.
160166
outputConfig : object
161167
Output configuration object.
168+
noiseParams : NoiseParameters
169+
Noise parameters object
170+
band : Band
171+
Band description object.
162172
debug : bool
163173
Debug flag
164174
@@ -168,9 +178,8 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, deb
168178
Debug information
169179
'''
170180
result = []
171-
if (self.l1caEnabled):
172-
intermediateFrequency_hz = outputConfig.GPS.L1.INTERMEDIATE_FREQUENCY_HZ
173-
frequencyIndex = outputConfig.GPS.L1.INDEX
181+
if (self.l1caEnabled and band == outputConfig.GPS.L1):
182+
intermediateFrequency_hz = band.INTERMEDIATE_FREQUENCY_HZ
174183
values = self.doppler.computeBatch(userTimeAll_s,
175184
self.amplitude,
176185
noiseParams,
@@ -180,14 +189,13 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, deb
180189
self.l1caCode,
181190
outputConfig,
182191
debug)
183-
numpy.add(samples[frequencyIndex],
192+
numpy.add(samples[band.INDEX],
184193
values[0],
185-
out=samples[frequencyIndex])
194+
out=samples[band.INDEX])
186195
debugData = {'type': "GPSL1", 'doppler': values[1]}
187196
result.append(debugData)
188-
if (self.l2cEnabled):
189-
intermediateFrequency_hz = outputConfig.GPS.L2.INTERMEDIATE_FREQUENCY_HZ
190-
frequencyIndex = outputConfig.GPS.L2.INDEX
197+
if (self.l2cEnabled and band == outputConfig.GPS.L2):
198+
intermediateFrequency_hz = band.INTERMEDIATE_FREQUENCY_HZ
191199
values = self.doppler.computeBatch(userTimeAll_s,
192200
self.amplitude,
193201
noiseParams,
@@ -197,21 +205,21 @@ def getBatchSignals(self, userTimeAll_s, samples, outputConfig, noiseParams, deb
197205
self.l2cCode,
198206
outputConfig,
199207
debug)
200-
numpy.add(samples[frequencyIndex],
208+
numpy.add(samples[band.INDEX],
201209
values[0],
202-
out=samples[frequencyIndex])
210+
out=samples[band.INDEX])
203211
debugData = {'type': "GPSL2", 'doppler': values[1]}
204212
result.append(debugData)
205213
return result
206214

207-
def isBandEnabled(self, bandIndex, outputConfig):
215+
def isBandEnabled(self, band, outputConfig):
208216
'''
209217
Checks if particular band is supported and enabled.
210218
211219
Parameters
212220
----------
213-
bandIndex : int
214-
Signal band index
221+
band : Band
222+
Band description object.
215223
outputConfig : object
216224
Output configuration
217225
@@ -220,9 +228,9 @@ def isBandEnabled(self, bandIndex, outputConfig):
220228
True, if the band is supported and enabled; False otherwise.
221229
'''
222230
result = None
223-
if bandIndex == outputConfig.GPS.L1.INDEX:
231+
if band == outputConfig.GPS.L1:
224232
result = self.isL1CAEnabled()
225-
elif bandIndex == outputConfig.GPS.L2.INDEX:
233+
elif band == outputConfig.GPS.L2:
226234
result = self.isL2CEnabled()
227235
else:
228236
result = False

0 commit comments

Comments
 (0)