gistlib
main.m% Read the .wav file [y, Fs] = audioread('file.wav'); % Define parameters f0 = 1000; % Original frequency of the signal v = 340; % Speed of sound in air fs_new = Fs * (v / (v + 20)); % Adjusted sampling frequency % Correct for Doppler shift y_doppler_corrected = resample(y, fs_new, Fs); % Apply STFT windowing to the signal windowLength = 1024; overlap = 512; spectrogram(y_doppler_corrected, windowLength, overlap, window(@hann, windowLength)); 450 chars16 lines
% Read the .wav file [y, Fs] = audioread('file.wav'); % Define parameters f0 = 1000; % Original frequency of the signal v = 340; % Speed of sound in air fs_new = Fs * (v / (v + 20)); % Adjusted sampling frequency % Correct for Doppler shift y_doppler_corrected = resample(y, fs_new, Fs); % Apply STFT windowing to the signal windowLength = 1024; overlap = 512; spectrogram(y_doppler_corrected, windowLength, overlap, window(@hann, windowLength));
main.m0 chars1 lines
gistlibby LogSnag