Creating an accurate Doppler spectrogram visualization
Show older comments
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!
Accepted Answer
More Answers (0)
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!