DSP MATLAB PROJECT
Name: Piyush Sanjay More
MIS: 612305056
Branch: TY Electrical
Topic of Project:
Spectrogram Generation and Visualization
of Real-World Sound
Objective:
To generate and visualize the spectrogram of a real-world sound
signal using MATLAB, showing how the frequency content of a
signal varies with time.
Code:
% Spectrogram Generation and Visualization of Real-World Sound
[x, fs] = audioread('[Link]');
sound(x, fs); % Play the audio
%Plot the waveform
t = (0:length(x)-1)/fs; % Time vector
figure;
plot(t, x);
xlabel('Time (s)');
ylabel('Amplitude');
title('Time Domain Waveform of Audio Signal');
grid on;
%Generate the Spectrogram
figure;
spectrogram(x, 256, 128, 256, fs, 'yaxis'); % 256-point FFT,
50% overlap
title('Spectrogram of Audio Signal');
colorbar;
%Enhanced Spectrogram Visualization (Optional)
figure;
window = hamming(512);
noverlap = 256;
nfft = 1024;
spectrogram(x, window, noverlap, nfft, fs, 'yaxis');
title('Enhanced Spectrogram with Hamming Window');
colorbar;
Outputs:
Conclusion:
This project demonstrates how MATLAB can be used to analyse
real-world signals in both time and frequency domains
simultaneously.
The spectrogram gives a visual insight into how diQerent
frequency components of a sound change over time — a key tool
in speech processing, music analysis, biomedical signals, and
more.