- https://fr.mathworks.com/matlabcentral/fileexchange/41334-imshow3d
- https://fr.mathworks.com/matlabcentral/fileexchange/29544-figure-to-play-and-analyze-videos-with-custom-plots-on-top
Creating an accurate Doppler spectrogram visualization
조회 수: 19 (최근 30일)
이전 댓글 표시
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!
댓글 수: 0
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulation, Tuning, and Visualization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!