필터 지우기
필터 지우기

How can I implement the fft function on both signals.

조회 수: 2 (최근 30일)
Mehmet Özgür Güzel
Mehmet Özgür Güzel 2022년 9월 7일
댓글: dpb 2022년 9월 7일
% generate a waveform
f0 =100;
fs=1000;
pw = 0.1;
pri = 1;
npulses = 100;
s = cos(2*pi*f0*(0:1/fs:pw)); % it can be any other waveform of your choice
s(round(fs*pri)) = 0; % PRI
s = repmat(s, npulses, 1); % npulses
% echo: delayed signal
tau = 0.3;
ntau = round(fs*tau);
amp = 0.5;
e = amp* circshift(s, ntau);
% add noise
sigma = 0.1;
r = s + e + sigma*randn(size(s));
y = pulsint(r);
Fn = fs/2
Fn = 500
Fco = 125; % Choose A Frequency > 0 & < fs/2
r_filt = lowpass(r, Fco, fs, 'ImpulseResponse','iir'); % Design An Elliptic Filter & Filter 'r'
figure
plot((0:length(s)-1)/fs, r_filt)
title('Filtered')
  댓글 수: 1
dpb
dpb 2022년 9월 7일
What both signals?
As to the Q?, it's simple enough; either call fft twice, once for each desired input; this, of course, means you've got to create two new variable for the results (or use one for whatever purposes desired first before computing the second).
Alternatively, and "the MATLAB way" would be to put both signals into an array by column and then call FFT() -- it is vectorized to treat each column as a variable.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by