[go: up one dir, main page]

0% found this document useful (0 votes)
21 views7 pages

Audio Signal Processing

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)
21 views7 pages

Audio Signal Processing

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
You are on page 1/ 7

MODERN ACADEMY

FOR ENGINEERING & TECHNOLOGY

Electronics and CommunicationsDepartment


Spring Semester - Academic Year 2022/2023
Novmber 2023

Article Name : Audio Signal Processing


Course Title: Digital Signal Processing
Course Code: ELCn425
Student Name 1 Mostafa Hesham Fouad
Student ID 1 4210344
Student Name 2 Ahmed Mohamed Abdelhamid
Student ID 2 4210343
StudentLevel 4st level
Section No. 5L-TH3
Course Instructor
Dr. Samier Mohamed Kamal

0|Page
Table of Contents
Objectives ............................................................................................. 2
Introduction ......................................................................................... 3
Methodology ......................................................................................... 4
Results & Discussion ...........................................................................5
References ............................................................................................ 6

1|Page
The Objectives:

The objective of the provided MATLAB code is to record audio input using the
specified parameters, analyze the recorded signal in both the time and frequency
domains, and save the recorded audio as a WAV file.
Objectives:
1. Setting up the audio recorder
2. Recording audio
3. Time domain analysis
4. Frequency domain analysis
5. Saving the recorded audio

2|Page
Introduction:

In many audio processing applications, it is necessary to record audio signals


and analyze their characteristics in both the time and frequency domains. This
MATLAB code provides a basic framework for recording audio, visualizing the
recorded signal in the time and frequency domains, and saving the recorded
audio as a WAV file.

3|Page
Methodology:

The methodology of this code involves setting up the audio recording


parameters, recording the audio, analyzing the recorded signal in both the time
and frequency domains, and saving the recorded audio as a WAV file.
1. Setting up audio recording parameters:
The code initializes variables for the sampling frequency (Fs), number of channels
(Channels), and bits per sample (bits). These parameters define the characteristics of the
audio recording.

2. Creating an audio recorder object:


The code creates an audio recorder object (r) using the audiorecorder function. The object
is configured with the specified sampling frequency, number of bits, and number of
channels.

3. Recording audio:
The code starts the audio recording using the recordblocking function. The duration of the
recording is set to Duration, which is specified as 10 seconds in the code. During the
recording, the code displays a message indicating that the recording has started and waits
until the recording is complete. After the recording is finished, another message is
displayed to indicate that the recording has stopped.

4. Obtaining the recorded audio data:


The code retrieves the recorded audio data from the audio recorder object using
the getaudiodata function. The audio data is stored in the variable X, representing the
recorded signal.

5. Time domain analysis:


The code generates a time domain plot of the recorded signal using the plot function. The
time vector t is created using the sampling frequency (Fs) and the length of the recorded
signal (X). The plot shows the amplitude of the signal over time.

6. Frequency domain analysis:


The code applies the Fast Fourier Transform (FFT) to the recorded signal using
the fft function. The FFT converts the time-domain signal (X) into the frequency domain.
The code calculates the frequency axis (F_0) and performs a shift on the FFT result (Y)
using the fftshift function. The magnitude spectrum of the shifted signal (Y_0) is obtained
by taking the absolute value. The frequency domain plot shows the amplitude of the
signal at different frequencies.

7. Saving the recorded audio:


The code saves the recorded audio as a WAV file using the audiowrite function. The
audio data (X), sampling frequency (Fs), and filename (myvoice.wav) are provided as
input parameters.

4|Page
Results & Discussion:
The MATLAB code you provided performs audio recording, time domain analysis, frequency domain
analysis, and saving of the recorded audio. Here is a discussion of the results you can expect from
running this code:
1. Time Domain Plot:

The code generates a time domain plot of the recorded signal. The x-axis represents time in
seconds, and the y-axis represents the amplitude of the signal. This plot allows you to visualize
how the signal changes over time. You can observe patterns, variations, or any other
characteristics of the recorded audio waveform.

2. Frequency Domain Plot:

The code performs a Fast Fourier Transform (FFT) on the recorded signal to convert it from the
time domain to the frequency domain. The resulting frequency domain plot shows the distribution
of frequencies present in the recorded signal. The x-axis represents frequency in hertz, and the y-
axis represents the amplitude of each frequency component. This plot helps you analyze the
different frequencies and their magnitudes in the recorded audio.

3. Saving the Recorded Audio:

The code saves the recorded audio as a WAV file named "myvoice.wav." The saved audio file
can be used for further analysis, processing, or playback outside of the MATLAB environment.

5|Page
References:
https://www.youtube.com/watch?v=B9cSAmrgz4s&t=767s

6|Page

You might also like