aboutsummaryrefslogtreecommitdiffstats
path: root/src/fl2k_iq.c
diff options
context:
space:
mode:
authorFelix Erckenbrecht <dg1yfe@stus-disco.de>2022-03-24 07:53:04 +0100
committerFelix Erckenbrecht <dg1yfe@stus-disco.de>2022-03-24 07:53:04 +0100
commitccc9d5f0f24e777e3da3d66420fea2256a59b120 (patch)
treed1950026e225165db7597346ce699fbddc3ea6a5 /src/fl2k_iq.c
parentb55ba0bf28063ef3d5e8aef8cdb807aeb848b4c2 (diff)
downloadosmo-fl2k-ccc9d5f0f24e777e3da3d66420fea2256a59b120.tar.gz
osmo-fl2k-ccc9d5f0f24e777e3da3d66420fea2256a59b120.tar.bz2
osmo-fl2k-ccc9d5f0f24e777e3da3d66420fea2256a59b120.zip
Add missing parameter: modulation index
Diffstat (limited to 'src/fl2k_iq.c')
-rw-r--r--src/fl2k_iq.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/fl2k_iq.c b/src/fl2k_iq.c
index dde3bb8..f7c2a1c 100644
--- a/src/fl2k_iq.c
+++ b/src/fl2k_iq.c
@@ -400,7 +400,7 @@ static inline float complex modulate_sample_ampliphase(const int lastwritepos, c
}
-void ampliphase_modulator(enum inputType_E inputType)
+void ampliphase_modulator(enum inputType_E inputType, const float modIndex)
{
unsigned int i;
size_t len;
@@ -444,7 +444,7 @@ void ampliphase_modulator(enum inputType_E inputType)
sample = (float) baseband_buf_cplx[i][0+swap] / 32768.0 + I * (float) baseband_buf_cplx[i][1-swap] / 32768.0;
/* Modulate and buffer the sample */
- lastamp = modulate_sample_ampliphase(lastwritepos, lastamp, sample);
+ lastamp = modulate_sample_ampliphase(lastwritepos, lastamp, sample, modIndex);
lastwritepos = writepos++;
writepos %= BUFFER_SAMPLES;
}
@@ -484,6 +484,7 @@ int main(int argc, char **argv)
int option_index = 0;
int input_freq_specified = 0;
enum inputType_E input_type = INP_REAL;
+ float modulation_index = 1.0;
#ifndef _WIN32
struct sigaction sigact, sigign;
@@ -495,7 +496,7 @@ int main(int argc, char **argv)
};
while (1) {
- opt = getopt_long(argc, argv, "ewd:c:i:s:t:", long_options, &option_index);
+ opt = getopt_long(argc, argv, "ewd:c:i:s:t:m:", long_options, &option_index);
/* end of options reached */
if (opt == -1)
@@ -514,6 +515,9 @@ int main(int argc, char **argv)
input_freq = (uint32_t)atof(optarg);
input_freq_specified = 1;
break;
+ case 'm':
+ modulation_index = atof(optarg);
+ break;
case 's':
samp_rate = (uint32_t)atof(optarg);
break;
@@ -641,7 +645,7 @@ int main(int argc, char **argv)
SetConsoleCtrlHandler( (PHANDLER_ROUTINE) sighandler, TRUE );
#endif
- ampliphase_modulator(input_type);
+ ampliphase_modulator(input_type, modulation_index);
out:
fl2k_close(dev);