demo
This commit is contained in:
parent
f2c74ffea8
commit
789e2e45d1
11
README.md
11
README.md
@ -18,11 +18,12 @@ to RF using software-defined radio (SDR) platforms, such as
|
||||
$ gcc gpssim.c -lm -O3 -o gps-sdr-sim
|
||||
```
|
||||
|
||||
## Realtime
|
||||
## Realtime by Gnuradio
|
||||
|
||||
Use -n option can connect to a TCP source in Gnuradio for realtime simulation.
|
||||
|
||||
The tcp source should be set in "Server" mode, listening to port 1234 (as default, it can be changed by.option -n).
|
||||
|
||||
See tcp.grc as a example.
|
||||
|
||||
### Generating the GPS signal file
|
||||
@ -76,7 +77,7 @@ Options:
|
||||
-b <iq_bits> I/Q data format [1/8/16] (default: 16)
|
||||
-i Disable ionospheric delay for spacecraft scenario
|
||||
-v Show details about simulated channels
|
||||
-n Use tcp connect to gnuradio for realtime simulation
|
||||
-n <port> Use TCP connection to Gnuradio TCP-Source for realtime simulation. (Default 1234).
|
||||
```
|
||||
|
||||
The user motion can be specified in either dynamic or static mode:
|
||||
@ -93,6 +94,12 @@ The user motion can be specified in either dynamic or static mode:
|
||||
> gps-sdr-sim -e brdc3540.14n -l 30.286502,120.032669,100
|
||||
```
|
||||
|
||||
Use Gnuradio to realtime simulate 3000s:
|
||||
|
||||
```
|
||||
> gps-sdr-sim -e brdc3540.14n -l 30.286502,120.032669,100 -n 1234 -d 3000
|
||||
```
|
||||
|
||||
### Transmitting the samples
|
||||
|
||||
The TX port of a particular SDR platform is connected to the GPS receiver
|
||||
|
4
gpssim.c
4
gpssim.c
@ -1661,7 +1661,7 @@ void usage(void)
|
||||
" -b <iq_bits> I/Q data format [1/8/16] (default: 16)\n"
|
||||
" -i Disable ionospheric delay for spacecraft scenario\n"
|
||||
" -v Show details about simulated channels\n",
|
||||
" -n Use TCP connect to Gnuradio TCP-Source for\n realtime simulation and port(default 1234)\n",
|
||||
" -n <port> Use TCP connect to Gnuradio TCP-Source for\n realtime simulation. (default 1234)\n",
|
||||
(USER_MOTION_SIZE)/10.0,STATIC_MAX_DURATION);
|
||||
|
||||
return;
|
||||
@ -1867,7 +1867,7 @@ int main(int argc, char *argv[])
|
||||
llh[2] = 10.0;
|
||||
}
|
||||
|
||||
if (duration<0.0 || (duration>((double)USER_MOTION_SIZE)/10.0 && !staticLocationMode) || (duration>STATIC_MAX_DURATION && staticLocationMode))
|
||||
if (duration<0.0 || (duration>((double)USER_MOTION_SIZE)/10.0 && !staticLocationMode) || (duration>STATIC_MAX_DURATION && staticLocationMode)&&usesocket==false)
|
||||
{
|
||||
printf("ERROR: Invalid duration.\n");
|
||||
exit(1);
|
||||
|
6
tcp.grc
6
tcp.grc
@ -124,7 +124,7 @@
|
||||
</param>
|
||||
<param>
|
||||
<key>_coordinate</key>
|
||||
<value>(272, 200)</value>
|
||||
<value>(280, 200)</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_rotation</key>
|
||||
@ -152,7 +152,7 @@
|
||||
</param>
|
||||
<param>
|
||||
<key>port</key>
|
||||
<value>2345</value>
|
||||
<value>1234</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>vlen</key>
|
||||
@ -1071,7 +1071,7 @@
|
||||
</param>
|
||||
<param>
|
||||
<key>args</key>
|
||||
<value>hackrf=81320f</value>
|
||||
<value>hackrf</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_enabled</key>
|
||||
|
@ -2,7 +2,7 @@
|
||||
##################################################
|
||||
# GNU Radio Python Flow Graph
|
||||
# Title: Top Block
|
||||
# Generated: Sun Apr 23 01:40:34 2017
|
||||
# Generated: Sun Apr 23 02:13:05 2017
|
||||
##################################################
|
||||
|
||||
if __name__ == '__main__':
|
||||
@ -60,7 +60,7 @@ class top_block(gr.top_block, Qt.QWidget):
|
||||
##################################################
|
||||
# Blocks
|
||||
##################################################
|
||||
self.osmosdr_sink_0 = osmosdr.sink( args="numchan=" + str(1) + " " + "hackrf=81320f" )
|
||||
self.osmosdr_sink_0 = osmosdr.sink( args="numchan=" + str(1) + " " + "hackrf" )
|
||||
self.osmosdr_sink_0.set_sample_rate(samp_rate)
|
||||
self.osmosdr_sink_0.set_center_freq(100e6, 0)
|
||||
self.osmosdr_sink_0.set_freq_corr(0, 0)
|
||||
|
Loading…
Reference in New Issue
Block a user