0% found this document useful (0 votes)
6 views4 pages

Spectrogram Visualization in MATLAB

The project focuses on generating and visualizing the spectrogram of a real-world sound signal using MATLAB. It includes code for playing an audio file, plotting its waveform, and creating both a standard and enhanced spectrogram. The conclusion highlights the utility of spectrograms in analyzing sound frequency components over time, applicable in various fields such as speech processing and music analysis.

Uploaded by

piyushmore738
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Spectrogram Visualization in MATLAB

The project focuses on generating and visualizing the spectrogram of a real-world sound signal using MATLAB. It includes code for playing an audio file, plotting its waveform, and creating both a standard and enhanced spectrogram. The conclusion highlights the utility of spectrograms in analyzing sound frequency components over time, applicable in various fields such as speech processing and music analysis.

Uploaded by

piyushmore738
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like