Creating an accurate Doppler spectrogram visualization

조회 수: 19 (최근 30일)
Patrícia
Patrícia 2023년 10월 20일
댓글: Patrícia 2023년 11월 3일
Hello! I'm trying to view and listen to an audio file (Doppler file). I want to display the spectrogram and have a scroll bar to navigate through the entire signal. Additionally, I'd like to be able to play or stop the audio.
I need something like this:
And I have this:
Here is my code:
fid = fopen('TCD_01.bin');
block_size = strread(fgetl(fid),'###block_size::%d');
block_number = strread(fgetl(fid),'###block_numbers::%d');
for k=1:8
fgetl(fid)
end
prf = strread(fgetl(fid),'###prf::%d');
offset = block_size * block_number;
fseek(fid,offset,'bof');
a = fread(fid, [4,inf],'float32')';
b1 = complex(a(:,2), a(:,1));
b2 = complex(a(:,4), a(:,3));
Fs=prf
NFFT = 128;
f_vec = [-floor(NFFT/2) : ceil(NFFT/2)-1] * Fs/NFFT;
figure, spectrogram(b1,hamming(128),64,f_vec,Fs,'yaxis');
caxis([0 20])
How can I achieve a result identical to the first part of the first image?
Thank you!

채택된 답변

Matt
Matt 2023년 10월 20일
Well there is quite a long way to go from this figure to a fully functionnal app like the one you are showing !
What you need is an app with callbacks connected to the scroll bar and the play/stop button.
It's not that easy to develop an app that is fast enough to display frames that are computed on the fly so I would recommend avoiding the app designer and go with something like this :
I used the second one, it is very nice and easy to modify for your needs.
Instead of having a callback function that simply display frames it will need to compute the image you want to show. It's not impossible but the computation need to be fast.
The play stop button will be the easy part, you can do a button with uicontrol connected to this :
https://fr.mathworks.com/help/matlab/import_export/record-and-play-audio.html#bsdl2eo-1
Additionnal infos :
https://fr.mathworks.com/matlabcentral/answers/483657-how-to-create-a-gui
  댓글 수: 1
Patrícia
Patrícia 2023년 11월 3일
Do you know how I can display the bottom signal? Right now, it can be just for 60 ms.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulation, Tuning, and Visualization에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by