Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NEED FM DEMODULATOR CODE FOR MATLAB

2,949 views
Skip to first unread message

Mehrdad

unread,
Jun 8, 1994, 7:34:51 AM6/8/94
to
I have a low frequency FM signal which I wish to demodulate. Has anybody
developed an M file which might assist?

Doug Schwarz

unread,
Jun 9, 1994, 9:43:49 AM6/9/94
to
In article <SPEMG1.71...@cardiff.ac.uk>, SPE...@cf.ac.uk (Mehrdad)
wrote:

> I have a low frequency FM signal which I wish to demodulate. Has anybody
> developed an M file which might assist?

If x is your signal to be demodulated, create the complex signal z = x +
jy, where y is the Hilbert transform of x. y can be obtained from an FIR
filter designed with the 'hilbert' option in the remez function, or z can
be computed directly with the hilbert function. Then, take the derivative
of unwrap(angle(z)). unwrap won't work very well if your original samples
are very far apart (i.e., too close to the Nyquist frequency).

Doug Schwarz
Eastman Kodak Company
sch...@kodak.com

Thomas Davis 575-4958 MSGID TLD1

unread,
Jun 9, 1994, 3:54:16 PM6/9/94
to

In article 2DF5...@cardiff.ac.uk, SPE...@cf.ac.uk (Mehrdad) writes:
>I have a low frequency FM signal which I wish to demodulate. Has anybody
>developed an M file which might assist?
>

There is probably an easier way, but this should work:

% simulate an PM signal

Fs = 5.12e6; % sample rate
N = 2^12; % # samples
t = (0:N-1)/Fs; % time

fc = 100e3; % carrier frequency
fm = 10e3; % modulation frequency
noise = 1e-4;

mod = 1e-1 * sin( 2*pi*fm*t+ 2*pi*rand(1,1) ); % sinusiodual phase modulation

y = cos( ( 2*pi*(fc*t+rand(1,1) ) + mod ) ); % real PM signal

% Now FM demodulate signal

% Simulate a quadrature detector and low pass filter to get
% complex base-band video. Or do it the easy way:

y = hilbert( y );

% calculate phase

phase = unwrap( angle(y) );

f = diff(phase) / ( 2*pi*diff(t(1:2)) ); % definition of frequency
% since diff(t) is constant
plot( t(1:N-1), f )
grid

________________________________________________________________
| Tom Davis | da...@adrs1.dseg.ti.com |
| SMTS, Texas Instruments | phone: (214) 575-4958 |
----------------------------------------------------------------

Bo Engstrom

unread,
Jun 15, 1994, 5:05:14 AM6/15/94
to
A nice alternative is to get rid of the very instable function unwrap by
differentiation of the phases of the complex numbers directly:

y = hilbert( your_fm_signal );
yd = y(2:length(y)).*conj(y(1:length(y-1))); % The frequency is now
f = angle(yd); % hidden in the phase of yd


/Bo Engstrom, bo.en...@lulea.trab.se
--
-------------------------------------------------------
Bo Engstrom PHONE: Int. +4692075443
Telia Research HOME: Int. +4692046478
Aurorum 6 FAX: Int. +4692075490

Bo Engstrom

unread,
Jun 15, 1994, 5:13:05 AM6/15/94
to
Sorry:
...
yd = y(2:length(y)).*conj(y(1:length(y)-1)); % Stupid parenthesis
...
0 new messages