how do i filter a modulated signal using sinc

조회 수: 3 (최근 30일)
matlab3232
matlab3232 2016년 11월 28일
how do i filter a modulated signal using sinc function of 40k Hz frequency with sampling rate of 705.6 kHz. so i can eventually demodulate the signal and listen to the audio. Any help is appreciated. thanks.
%Set cutoff frequency and delay of the impulse response peak
Fc = 40e3;
tau = 142e-8;
%Two-sided bandwidth of the lowpass filter
B = 2*Fc;
%Set up time array and sampling variables for the "ideal" lowpass filter
%Impulse response length >> 1/B to approximate the ideal filter
time1 = linspace(-10/B,10/B,4000)';
dt1 = time1(2) - time1(1); %Sampling interval for ideal filter time array
Fs1 = 1/dt1; %Sampling frequency
dt2 = 1/(10*B); %Sampling interval for practical filter time array
time2 = (0:dt2:(2*tau))'; %Time array for the practical filter
Fs2 = 1/dt2; %Sampling frequency
N = length(time2); %Number of samples in practical filter
%Compute impulse responses for ideal and practical filters
ht_ideal = B*sinc(B*time1);
% ht_windowed = B*sinc(B*(time2 - tau)).*ones(N,1); %with rectangular window
ht_windowed = B*sinc(B*(time2 - tau)).*hanning(N); %with hanning window
figure subplot(2,2,1)
plot(time1,ht_ideal)
title('ideal low pass filter');
hold on subplot(2,2,2) plot(time2,ht_windowed)
title('practice low pass filter'); hold on
fid = fopen('C:\Users\birbahadur\Desktop\fall2016\signal and system\project1\dsbsc.bin','rb');
a = fread(fid,'float32');
fclose(fid);
iend=length(a);
subplot(2,2,3);
plot(a);
title('input signal');
hold on
allsongs=ifftshift(ifft(a));
tsong=allsongs(1:12:705600);
amsong1=conv(tsong,ht_ideal);
%soundsc(abs(song1)*100)
%z = amdemod(y,Fc,Fs)
song1 = amdemod(abs(amsong1),40000,705600);
subplot(2,2,4);
plot(abs(allsongs));
%soundsc(y,Fs,nBits)
soundsc(song1)

답변 (0개)

카테고리

Help CenterFile Exchange에서 PHY Components에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by