I am using OFDM system in Matlab, I want to use an analog filter after the DAC. Because we don't a simulation for the DAC, the generated OFDM analog signal does not have a specific frequency (they only have normalized frequency). When I design the analog filter, I have to specify the frequency (not normalized frequency as in digital filters). So I am not able to filter my OFDM signal with the analog filter. Any ideas on how to do that? I have been trying to use slim Matlab command to do that, I managed to apply an analog filter on sinusoidal signals as follows:
clc
clear all
close all
f1 = 1000; % signal frequency
f2 = 2000; % signal frequency
f3 = 3000; % signal frequency
fs= 10000; % DAC sampling Rate
Ts= 1/fs; % DAC sampling time
N= 4000; % Number of points
n= 0:N-1; % sampling index
x= cos(2*pi*f1*n*Ts)+ cos(2*pi*f2*n*Ts)+cos(2*pi*f3*n*Ts);
df=-0.5:1/N:0.5-(1/N); %frequency bins
X=fftshift(fft(x,N));
figure;plot(fs*df,abs(X)/N); %original signal
%%
%filter design
order=14 % Filter order
Rs=30 %stopband attenuation
fc=1500; % filter cutoff frequency
[b,a] = cheby2(order,Rs,[2*pi*fc],'low','s');
figure;freqs(b,a);
% [z2,p2,k2] = cheby2(order,Rs,2*pi*fc,'low','s');
% [b2,a2] = zp2tf(z2,p2,k2);
% figure;freqs(b2,a2);
% [zeros, poles, gain] = butter(order,[2*pi*fc],'low','s'); %generate LPF zeros, poles, and filter gain.
% [b2,a2] = zp2tf(zeros, poles, gain); %convert to transfer function form of b, a coefficients
% figure;freqs(b2,a2);
%%
%apply the filter
% create system
myFilter = tf(b,a);
% apply filter to time domain signal
[y, time] = lsim(myFilter,x,n*Ts);
Y=fftshift(fft(y));
figure;plot(fs*df,abs(Y)/N);
**bold**
or*italics*
formatting, not`source code`
formatting. Even done right, this formating edit contribute little to the question itself, but every time you , as long as you have not a lot of reputation points, do an edit, it ends up in an edit queue that other people (such as me) have to process. So, you're actively binding time to do low-improvement edits! Please make sure an edit is really worth it. $\endgroup$