How to generate a bandpass signal in Matlab and sample it ?

조회 수: 9 (최근 30일)
Abhishek
Abhishek 2022년 8월 9일
답변: Nithin Kumar 2023년 6월 8일
I am trying to write a code that samples a bandpass signal with proper sampling frequency. I tried bandpass function but failed.
  댓글 수: 2
Chunru
Chunru 2022년 8월 9일
What kind of bandpass signal? Random or deterministic?
Abhishek
Abhishek 2022년 8월 9일
Deterministic one

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

답변 (1개)

Nithin Kumar
Nithin Kumar 2023년 6월 8일
Hi Abhishek,
I understand that you are facing an issue while generating a bandpass signal in MATLAB.
To generate a bandpass signal with proper sampling frequency using MATLAB, kindly refer to the following example:
fs = 1000; % sampling frequency in Hz
t = 0:(1/fs):1; % time vector
noise = randn(size(t)); % generating white noise with normal distribution
[b,a] = butter(2, [50/(fs/2), 200/(fs/2)], 'bandpass'); % generating filter coefficients for a 2nd order bandpass filter with a passband between 50Hz and 200Hz
x = filter(b,a, noise); % applying filter to noise signal
figure;
plot(t,x);
xlabel('Time (s)');
ylabel('Amplitude');
title('Bandpass Signal');
For more information regarding the "butter" and "filter" functions, kindly refer to the following documentation:
I hope this answer helps you.

카테고리

Help CenterFile Exchange에서 Signal Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by