hpdvanwyk / fm-multimix

A multiple channel FM downmixer.
GNU General Public License v3.0
24 stars 4 forks source link

expanding the bandwidth #2

Open anonymouscommitter opened 11 years ago

anonymouscommitter commented 11 years ago

Hello, As the dongle supports a sample rate up to 2.8Mhz, I tried to modify the sample rate found in SAMP_RATE but it would still spit out a 'Difference between maximum and minimum freqencies exceed sampled spectrum' error. I tracked that to 'if(max-min > 1000000)' in fm_multimix.c which I modified for 'if(max-min > (SAMP_RATE - 14300))', after this it stopped spitting out the error but the sample rate of the demoulated output seems to be off (too low). Any clues as to what else needs to be modified to allow a higher sample rate?

hpdvanwyk commented 11 years ago

Hi. A few things come to mind:

  1. In the arguments given to rtl-fm in demod_proc.c there is a -i 46, this controls the decimation/interpolation between the input and output of rtl-fm. For 46 this gives an input of 22050*46 = 1014300 Hz. This would need to be changed to use another sampling rate.
  2. The shape in the spectrum being looked for assumes a certain FFT resolution. Changing the sampling rate will change the resolution. For the shape to match the bandwidth of NBFM either the FFT window must be changed (FFT_LEN) so that the resolution matches that at the default sample rate or the values of double convol [] need to be changed to match the shape of a NBFM transmission at whatever resolution the system is currently running. I was too lazy to calculate the theoretical spectrum of FM so I used GNU Radio with its NFMB block, modulated some noise with it and fed that to fft_conv_gen.c . This gives reasonable values for double convol [].