NBFM
This objects implements an analog NBFM modulator/demodulator.
It can be used as an automatic demodulator for the DDC object.
Object NBFM {
constructor NBFM( String aname );
bool configure( {'modulation_index': number });
IQData modulate( Samples input );
FloatData demodulate( IQData in );
}
This object can be used with the Digital Down Converter
.configure
Defines the modulation index for the modulator/demodulator. The default value is internally set to 0.25.
modem.configure( {'modulation_index': 0.2} );
.modulate
This method needs a FloatData object input containing real (non-complex) data for modulation (you may use the getReal() or getImag() methods of IQData objects).
IQData iq = modem.modulate( FloatData blockIn );
.demodulate
FloatData symbols = modem.demodulate( IQData );
Example
var audio = new IQData('audio');
if( !audio.loadFromFile('lamableu.wav')) {
print('file not found.');
exit();
}
// retrieve channel (mono audio)
var speak = audio.getReal();
// now generate IQ signal from FM audio
var fm = new NBFM('modulator');
fm.configure( {'modulation_index': 0.1} );
var IQ = fm.modulate( speak );
Last update: December 1, 2021