Borrar filtros
Borrar filtros

Frequency plot not working properly when using IFFT

1 visualización (últimos 30 días)
David Harra
David Harra el 21 de Mzo. de 2022
Comentada: David Harra el 21 de Mzo. de 2022
I have impoted an ultrasound signal to matlab and I was to look at this signal in the frequency spectrum, but I am not sure if I am missing some information, but my plot doesn't work. What I have tried is as follows. My imported file contains 8600 x 1 arrays for my Data and Time vectors. Any input would be appreciated :)
FName = 'Tit_10MHz_110F.flxhst';
MyData = read_history(FName);
Time = MyData.TimeRecB.Time;
Data= MyData.DataRecB(1).Data;
fft_points = 2 ^ nextpow2(size(Time, 1));
time_step=(Time(2)-Time(1));
frequency_spectrum = fft(Time, fft_points);
frequency_spectrum = frequency_spectrum(1:end / 2, :);
frequency_step = 1 / (fft_points * time_step);
frequency = ([1 : fft_points / 2] - 1) * frequency_step;
figure(5)
plot(frequency, abs(frequency_spectrum));

Respuesta aceptada

VBBV
VBBV el 21 de Mzo. de 2022
Editada: VBBV el 21 de Mzo. de 2022
time_step=(Time(2)-Time(1));
Check with timestep. It may not be constant difference between first two values in Time vector
  1 comentario
David Harra
David Harra el 21 de Mzo. de 2022
Hey VBBV, I think this seems to be the case. It is not exactly constant. I am not to sure how to fix this issues. Any suggestions?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Get Started with Signal Processing Toolbox en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by