MMC/test/FM_IQ_Demod.m
2022-06-19 19:03:29 +08:00

20 lines
667 B
Matlab
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function [y_FM_demodulated] = FM_IQ_Demod(y)
%This function demodualtes an FM signal. It is assumed that the FM signal
%is complex (e.g. an IQ signal) centered at DC and occupies less than 90%
%of total bandwidth.
d=normalize(y);%normalize the signal to put in unit circle range
realsignal=real(d); %real part of normalized siganl.
imagsignal=imag(d); %imaginary part of normalized signal.
realsignal_delay=realsignal(2:end,1);
imagsignal_delay=imagsignal(2:end,1);
size_signal=size(d);
%最小角度法解调X(n)=Q(n)I(n-1)-I(n)Q(n-1);
y_FM_demodulated = realsignal(1:size_signal-1).*imagsignal_delay-imagsignal(1:size_signal-1).*realsignal_delay;
end