[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Decoding fm files by MATLAB

From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Decoding fm files by MATLAB
Date: Fri, 16 Jan 2004 09:56:46 -0800
User-agent: Mutt/1.4.1i

On Fri, Jan 16, 2004 at 08:00:42AM -0800, How Chee Hew wrote:
> Hi,
> Is it correct to say that the  fm95_5.dat contains
> more than 1 radio station ? Tried also using Matlab
> but to no avail. Is this the same file that can be use
> for the dual channel FM demodulation fm_demod2.cc ? 
> Did not have a Linux machine yet to try it on.
> Regards,
> HowChee

It contains four stations.  Take a look at this FFT screen shot to see
what you've got.  <http://www.comsec.com/data/fm95_5.png>

The data is sampled at 20e6 samples/sec, and the data format is
little-endian binary shorts.

One of the stations is located at 5.75e6 in the sampled data.
If you're messing with octave or Matlab, you'll need to bandpass
and translate that signal (or one of the others) to baseband
first.  There are of course lots of choices about how to do that.

The stations aren't placed correctly in the sampled data to be
directly demodulated with fm_demod2.  fm_demod2 tunes the RF front end
such that the two stations it's looking for are symmetrically placed
about the center of the IF (5.75e6).  With some tweaking of the code,
you could make it work with the existing data.

The octave code below (which I suspect will run under Matlab) will
read the raw data.



# Copyright 2001 Free Software Foundation, Inc.
# This file is part of GNU Radio
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING.  If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.

function v = read_short_binary (filename, count)

  ## usage: read_short_binary (filename, [count])
  ##  open filename and return the contents, treating them as
  ##  signed short integers

  if ((m = nargchk (1,2,nargin)))
    usage (m);

  if (nargin < 2)
    count = Inf;

  f = fopen (filename, "r");
  if (f < 0)
    v = 0;
    v = fread (f, count, "short");
    fclose (f);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]