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;
[hr, hrzp] = hilbertfir(fs);
Hr = fft(hrzp);
Hrp = fftshift(Hr);
figure
N = length(hrzp);
f = fs*((0:N-1)/N - 0.5);
plot(f,20*log10(abs(Hrp))); grid;
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);
Rp = 3; Rs = 100;
[n,Wn] = cheb2ord(Wp,Ws,Rp,Rs);
[b,a] = cheby2(n,Rs,Wn);
figure
freqz(b,a,2048,fs);
title('Filter Design for White Noise Filtering');
White Noise Filtering
Nx = 5*fs;
noise = rand([1,Nx]);
noiseBP = filter(b,a,noise);
noiseABP = filter(hr,1,noiseBP);
figure
pwelch(noiseABP);
title({'Power Sectral Density (Welch\primes method)';'Filtered White Noise'})
FM Modulation
t = (0:(5*fs-1))/fs;
fm = 2;
wt = 60*sin(2*pi*fm*t);
w = cumsum(wt/fs);
xm = exp(j*2*pi*w);
noisefm = real(xm.*noiseABP);
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')