Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

Title of the

Signal Analyzer
project

Section number

Student names

and IDs
Table of Contents

Proposed Solution and Design.........................................................................................................3

Background and Theory...............................................................................................................3

Signal Analyzer:.......................................................................................................................3

Time Domain Analysis............................................................................................................3

Frequency Domain Analysis....................................................................................................4

Steps of Building MATLAB Code..............................................................................................4

Available Block Diagram.............................................................................................................5

MATLAB Code Photos................................................................................................................5

Simulation and Results....................................................................................................................9

Steps for conducting simulation..................................................................................................9

Discussion..................................................................................................................................10

Conclusion and Discussion............................................................................................................13

Future work................................................................................................................................13
Proposed Solution and Design

Background and Theory

Signal Analyzer:

An electronic device known as a signal analyzer is used in a variety of settings, including

research labs, electronics, and telecommunications, to measure and analyze electrical signals. It

records, visualizes, and analyzes properties of several signal types, including analog, digital,

audio, video, and RF signals, such as voltage, frequency, amplitude, phase, distortion, and noise.

Signal analyzers assess amplitude and power as well as perform frequency, time-domain, and

spectrum analysis. Additionally, they examine signal distortion, modulation, and noise; some

models even include real-time analysis. There are three different types of signal analyzers:

software-based solutions, portable handheld devices, and tabletop instruments. They are essential

to the design, development, and debugging of electronic systems and communication equipment

by engineers, technicians, and researchers. While the figure below is the example of GUI already

designed in MATLAB.

Figure 1 GUI in MATLAB

Time Domain Analysis

Time domain analysis is the study of a signal's behavior in the time domain, or the observation of

the signal's evolution through time. The rising time, fall time, pulse width, and general waveform
characteristics are the main considerations in this analysis. It sheds light on a signal's timing and

amplitude changes, among other temporal characteristics.

Frequency Domain Analysis

Frequency domain analysis entails analyzing a signal's properties and frequency content using

methods like the Fourier Transform or FFT. It enables measurements of variables like dominant

frequency and harmonic distortion and offers insights into the distribution of signal energy across

frequencies. Using this technique, signals in the frequency domain can be understood and

manipulated in signal processing, communications, control systems, and acoustics. In processes

like filtering, compression, system design, and performance assessment, it is essential.

Figure 2 Time and frequency domain of signals

Steps of Building MATLAB Code

The steps listed below demonstrate how the suggested GUI is created using MATLAB.

 Open MATLAB, then by using guide open new GUI file and start working on it.

 Place axis according the plots require, then place edit text blocks for frequency, phase,

amplitude and time.

 Add text above each parameter.

 Place push buttons for frequency domain, time domain and clearing the plot.

 After completing the design part when you save it. it will automatically generate .m file

after that we write our codes for plotting of frequency and time graph along with clear.
Available Block Diagram

The proposed GUI for the signal analyzer is shown in the figure below. The computer will ask

for details like frequency, phase, amplitude, and time duration. Three buttons are provided, clear,

time domain plot, and frequency domain plot. Additionally, it had four parameters: phase, time,

amplitude, and frequency. These buttons will plot the two plots, and the clean button will clear

both the graphs and the parameters so that you can set new values.

Figure 3 GUI design

MATLAB Code Photos

The clr callback function is for the clearing of graph. The str2double command is used in it

which convert the input parameter to integer value to start and for further working of code
Figure 4:function for clear callback

The A callback function is for the amplitude of graph. It will start its working when the value for

amplitude is inserted in the parameters block. The str2double command is used in it which

convert the input parameter to integer value to start and for further working of code.

Figure 5:function for amplitude callback

The t callback function is for the time of graph. It will start its working when the value for time

is inserted in the parameters block. The str2double command is used in it which convert the input

parameter to integer value to start and for further working of code.

Figure 6: function for time callback


The f callback function is for the frequency of graph. It will start its working when the value for

frequency is inserted in the parameters block. The str2double command is used in it which

convert the input parameter to integer value to start and for further working of code.

Figure 7: function for frequency callback

The p callback function is for the phase of graph. It will start its working when the value for

phase is inserted in the parameters block. The str2double command is used in it which convert

the input parameter to integer value to start and for further working of code.

Figure 8:function for Phase angle callback

The td callback function is for the time plotting of graph. It will start its working when the value

for time is inserted in the parameters block. The str2double command is used in it which convert

the input parameter to integer value to start and for further working of code.

b= A∗sin(2∗pi∗f ∗t 1+ p) is the signal which we are using for the plotting. Frequency is 2Hz in

it. Figure is given below, plotted between the time of 0 to 10sec:


Figure 9:function for time plot callback

The fd callback function is for the frequency plotting of graph. It will start its working when the

value for frequency is inserted in the parameters block. The str2double command is used in it

which convert the input parameter to integer value to start and for further working of code.

b= A∗sin(2∗pi∗f ∗t 1+ p) is the signal which we are using for the plotting. Freqency is 2Hz in

it. fft and fftshift command is used for converting time domain signal to frequency domain

signal. figure is given below:

Figure 10: function for frequency plot callback


Simulation and Results

Steps for conducting simulation

The steps for simulations are below:

 Start with the command window, open the m file, and run the guide.

 With this, the GUI window will open.

 Changed the settings in accordance with the demand by selecting new GUI and plot axis,

button, and text by various blocks.

 By saving, a MATLAB m file of this GUI will be created.

 To use the GUI file, we must enter the values for amplitude, time, frequency, and phase

and then match them to the indicated values.


 By hitting the time domain button, the time domain graph will be plotted, and the

frequency domain button will plot the frequency domain graph.

Discussion

Figure 11 Time response

The findings of the time domain using the parameters we provided are displayed in the above

figure. The parameters we used were amplitude 1.5, time 0 to 10 seconds, phase 180 degrees, and

frequency 3.5 Hz. The b=A*sin(2*pi*f*t1+p) function is used to depict the sinusoid signal. It

demonstrates how this function's variation with regard to time for the specified parameters. Due

to the 180° phase shift, it is evident from the figure that it does not begin at zero. The signal is

shifted in accordance with the entered phase. The signal has a 1 amplitude and a 0 to 10 s time

scale. The cycle frequency is 3.5 Hz.


Figure 12 Frequency response

The signal with the provided parameters of amplitude 1.5, phase 180, and frequency 3.5 Hz is

depicted in the above picture as having a frequency response. The amplitude is reduced by half

when moving from the time domain to the frequency domain, as seen in the equation below:

1
G( jw)= ( δ ( f −f 0 ) +δ ( f + f 0 ) )
2

Because of this, 0.75 amplitude rather than 1.5 is displayed. The -3.5Hz and 3.5 Hz is displayed

on graph. To shift from the time domain to the frequency domain, Fourier transform helps us in

this.
Figure 13:clearing the plot

Clears the plot if clear button is pressed.


Conclusion and Discussion

A signal analyzer is constructed using the MATLAB graphical user interface. The user must

enter information for the operational parameters, time axis, frequency range, amplitude, and

phase according to the system. When a button is selected to choose between plotting in the time

domain and the frequency domain, our system will read data from the input and do so. After

confirming the input values, the graphical user interface generates the outcome. The time domain

graph depicts a sine signal with a frequency of and a phase shift of 180° across a time range of.

The frequency response has an amplitude of 1.5 due to the Fourier transform feature. The

δ ( f −f 0 ) attribute plots the frequency of the graph at f, where f is the frequency 3.5Hz. By

focusing on this assignment, we gained knowledge of the MATLAB GUI and the distinction

between the time and frequency dimensions. Today, we are able to create graphical user

interfaces and the algorithms that go with them. This task allowed us to improve our modeling

and programming abilities in MATLAB.

Future work

We can utilize several other factors to compute the modulation of a signal, such as amplitude

modulation and frequency modulation, as this project only illustrates the time and frequency

response of a signal.

You might also like