EXAMPLE OF NOISE BAND FRECUENCY MODULATION ALGORYTHMG USING ANALYTICAL SIGNALS

Contents

 Created by Juan-Pablo Caceres 12-Jul-2006.
 Last Revision: Under Subversion Control System
clear all
close all

Optimal FIR Hilbert transformer design

fs = 10000; %Sampling Rate in Hz
[hr, hrzp] = hilbertfir(fs); %Parks-McClellan design

Hr = fft(hrzp); % Freq. response of optimal SSB filter
Hrp = fftshift(Hr);

%Plot
figure
N = length(hrzp);
f = fs*((0:N-1)/N - 0.5);
plot(f,20*log10(abs(Hrp))); grid; % Don't normalize (see below)
s = sprintf(['Length %d Optimal Chebyshev FIR',...
             ' Single-Sideband-Filter Freq. Response'],257);
title(s);
xlabel('Frequency (Hz)');
ylabel('Gain (dB)')

Filter Design for White Noise Filtering

Wp = [1500 1700]/(fs/2); Ws = [1400 1800]/(fs/2); %Noise centered at 1600Hz
Rp = 3; Rs = 100; %Filter specs
[n,Wn] = cheb2ord(Wp,Ws,Rp,Rs); %Chebyshev Type II filter order
[b,a] = cheby2(n,Rs,Wn); %Design Chebyshev Type II digital filter

%Plot
figure
freqz(b,a,2048,fs);
title('Filter Design for White Noise Filtering');

White Noise Filtering

Nx = 5*fs; %5 seconds
noise = rand([1,Nx]);
noiseBP = filter(b,a,noise); %Bandpass filtering
noiseABP = filter(hr,1,noiseBP); %Hilbert Transform

%Plot
figure
pwelch(noiseABP);
title({'Power Sectral Density (Welch\primes method)';'Filtered White Noise'})

FM Modulation

t = (0:(5*fs-1))/fs;
fm = 2; %Modulation Frecuency (Hz)
wt = 60*sin(2*pi*fm*t); %60Hz of modulation width
w = cumsum(wt/fs); %incorporate inst. freq. dependence on realtive phase
xm = exp(j*2*pi*w); %Time varying analytical signal
noisefm = real(xm.*noiseABP); %Noise modulation

%Plot
figure
spectrogram(noisefm,2^9,[],2^12,fs,'yaxis');
title('Spectrogram of the FM modulated Filtered Noise')

wavwrite(noisefm/(max(abs(noisefm)))*0.9,fs,'noisefm_examp.wav')