Problems with the creation of a randomic signal
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuesta aceptada
Paul
el 23 de Ag. de 2023
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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Statistics and Linear Algebra en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
