Problems with the creation of a randomic signal
1 回表示 (過去 30 日間)
古いコメントを表示
Hello everyone, i'm having a problem in my code, trying to create a random signal with monolateral bandwidth = 5 kHz, I wrote these lines:
fs=200000; %sampling frequency
B = 5000; %bandwidth
rng(1);
x = rand(1,n);
x = lowpass(x,B,fs);
The problem is that the signal thus obtained has a monolateral bandwidth = 20 kHz. What am i doing wrong? Anyone to suggest me what i should correct?
Below the signal i get with my lines, my goal is to get a signal which, zooming in the image, like i did in the left picture, has a bandwidth = 0.5. I really hope someone can help me out. Thanks in advance.


0 件のコメント
採用された回答
Paul
2023 年 8 月 23 日
Hi Andrea,
How are you defining the bandwdith?
fs=200000; %sampling frequency
B = 5000; %bandwidth
rng(1);
n = 1e4; % not supplied in the Question
x = rand(1,n);
[xf,d] = lowpass(x,B,fs);
figure
[h,freq]=freqz(d,4096,fs);
plot(freq,abs(h)),grid
xline(5e3)
Is that not the desired amplitude response of the filter? It seems to match up well with your plot.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!