Problems with the creation of a randomic signal

5 visualizaciones (últimos 30 días)
Andrea
Andrea el 22 de Ag. de 2023
Comentada: Andrea el 28 de Ag. de 2023
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.

Respuesta aceptada

Paul
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);
lowpass can return the digital filter used to process the signal
[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.
  1 comentario
Andrea
Andrea el 28 de Ag. de 2023
Thank you, I just needed to add a steepness parameter to my bandpass function.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Statistics and Linear Algebra en Help Center y File Exchange.

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by