# How to filter OFDM Signal with an analog filter

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);

• same as your previous RRC question: you simply apply a digital filter that approximates the analog filter. There's no analog signals in your PC, and OFDM is a digital signal anyway, so only the digital equivalent of the analog system would matter to the receiver, anyway. Jun 18, 2020 at 9:06
• I want to use an analog filters provided by Matlab, I know it is easy to use a digital filter and pretend that I am using an analog filter. please check my code, I made it for cos signals. I am trying to apply the same method on OFDM system. Jun 18, 2020 at 9:48
• @alyssaeliyah I said it before: Using code formatting for highlighting words is not appropriate. Please don't do that. If you want to emphasize something, use **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. Jun 18, 2020 at 10:00
• you've been told that by me two or three times, and by Andy. yes. yes you can. Jun 18, 2020 at 10:38
• and I've never seen an analog RRC filter, so I doubt you actually even should want to simulate one. Jun 18, 2020 at 10:38