Matlab Square Wave Signal Generation

What is Square Wave signal Generator?

A “square wave” is a sort of non-sinusoidal waveform, most normally experienced in gadgets and sign preparing. An optimal square wave substitutes consistently and momentarily between two levels. Its stochastic partner is a two-state direction.

Function generator: The generator which is gear or gadget used to produce the powerful electrical form or waveforms over a wide scope of frequencies. The waveforms created by the capacity generator are a three-sided wave, square wave, sine-wave, and saw-tooth wave.

Uses of square wave signal generator?

  • Square waves are portrayed as far as period, recurrence and adequacy.
  • The square wave generator is characterized as an oscillator that gives the yield with no contribution, with no contribution to the sense we should give contribution inside zero seconds that implies it should be a drive input.
  • This generator is utilized in advanced sign preparing and electronic applications.
  • The square wave generator is otherwise called Astable Multivibrator or free-running and the recurrence of the square wave generator is autonomous of the yield voltage.

Why are square waves treated as dangerous?

The square waves can be amazing and captivating to look however, they are hazardous for swimmers and boats. At the point when two arrangements of wave frameworks slam into one another it brings about structure or wave designs that resemble squares across the sea.

The benefits of the square wave signals are listed below

  • It has a very simple architecture.
  • The Maintenance cost is affordable and it is easy to manage.
  • Overall Low cost.
  • Flexible in nature.
  • Easy built design.
  • Not so tricky and complex.

Generic Steps to build program logic of square wave signal generation:

Step 1:

Take inputs from the users like Amplitude of the square wave A1, frequency of the square wave F1, duty cycle of the wave Dc1.

Step 2:

Find f1(frequency) with the help of formula à f1 = f1 * 2 * pi;

Step3:

Now that we are done with taking inputs from the users and calculating the values of required dimensions, next step is to use square() and stem() functions, followed by axis() function to get the desired output that is to generate square wave signals.

MATLAB Code as follows:

clear all;


a1 = input('Enter amplitude of the square wave A1- - - - - - >');


f1 = input('Enter the frequency of the square wave F1- - - - - - >');


dc1 = input('enter the duty cycle of the wave Dc1- - - - - - >');


f1 = f1 * 2 * pi;


t1 = - 10 : 0.01 : 10;


y1=a1 * square(f1 * t1 , dc1);


stem(t1,  y1);


axis([0 1 -6.7 2.2])

Output: Command prompt of MATLAB asking users to enter input values.

Enter amplitude of the square wave A1- - - - - - >
56
Enter the frequency of the square wave F1- - - - - - >
55
enter the duty cycle of the wave Dc1 - - - - - - >
3

The below screenshot shows how the above piece of code had generated the signal waves with the given input dimensions by the users.

Matlab Program- (Square wave signal Generation)

Related Topics

Matlab Unit impulse signal generation

What is the Necessity of learning Matlab programs? Matlab Programming Examples give you an idea of typical Matlab programs in a nutshell.Matlab programming should be utilizing object-oriented programming, GUI programming, and...

3 minutes read.

Differentiation in Matlab

Differentiation in Mathematics In maths, Derivatives are an essential device of math or calculus. For instance, derivative of the situation of a moving article regarding time is the item's speed: this...

6 minutes read.

MATLAB Operators

What is an Operator? A specific operation is performed by using a symbol which is called an operator. Example: A+B, where A, B are called operand and '+' is called operator. If you...

8 minutes read.

MATLAB Loops

Loops in programming Concept of looping is used to execute instructions repeatedly. It helps coders to reduce lines of code by setting a condition. In looping first a condition is fixed,...

3 minutes read.

MATLAB’s Array

What is an Array? An array is a collection of similar datatype elements in contiguous memory location. Every element in array is stored with an index number starting from 0. First...

4 minutes read.

MATLAB Features

MATLAB Features MATLAB (abbreviation for matrix laboratory) is an interactive programming environment that eases high-power computations in the IT world. Initially, it was developed with the intention of matrix calculation only....

4 minutes read.

MATLAB Setup And Environment

MATLAB Setup And Environment MATLAB System Requirements As we have already discussed the prerequisite to begin the learning journey of MATLAB now let us drive into some technical system requirements. RAMàMinimum 4GB or...

3 minutes read.

MATLAB Linear Convolution problem solving

What is linear convolution? In science (specifically, useful examination), convolution is a numerical procedure on two capacities (f1 and g1) that communicates how the state of one is adjusted by the...

4 minutes read.

Matlab Simulink

What is Simulink? Simulink is a re-enactment and model-based plan climate for dynamic and installed frameworks, incorporated with MATLAB. Simulink, additionally created by "MathWorks", is an information stream graphical programming language apparatus...

7 minutes read.

MATLAB Scripts

Scripts Introduction Matlab Script represents some programs and is executed like we execute command in the command window of Matlab’s environment. Matlab script is also defined as a sequence of commands;...

6 minutes read.

Matlab Graphic image

Matlab’s Graphic image Images are stored as arrays of numeric data in MATLAB® environment, so you can perform various sort of analysis on them to better visualize it. Picture Processing applications are given...

3 minutes read.

Matlab function

Introduction: Functions in MATLAB are composed with code that link one variable with another, and yielded output is connected precisely to one specific information that shapes a significant piece of any...

6 minutes read.

MATLAB Tutorial

Introduction of MATLAB In this MATLAB(stands for matrix laboratory) tutorial, we will cover core concepts of MATLAB and provide a solid foundation to enhance high computing skills. We are going to...

4 minutes read.

MATLAB Variables

What are variables? A variable is a storage location or a container to store or hold data. In programming, variables are used to reservedata created by the programmers so that it...

4 minutes read.

Matlab Calculus

Analytics Calculus is significant in various fields like designing, physical science, and different sciences, yet the estimations are finished by machines or PCs, regardless of whether they are into Physics...

3 minutes read.

MATLAB Gaussian Pulse

Gaussian pulse shape description: The diagram of a Gaussian is a trademark symmetric "ringer bend" shape. The boundary an is the stature of the bend's pinnacle, b is the situation of...

3 minutes read.

matlab Integral

What is integration? In maths, Integral allots numbers to functions in a manner that portrays relocation, region, volume, and different ideas that emerge by consolidating tiny information. The way toward discovering...

5 minutes read.

MATLAB vs Other Languages

MATLAB vs Other Languages If we try to find which is the best computer programming languages, the answer is not straightforward, and that might sound similar to asking which is the...

3 minutes read.

MATLAB special graphic function

In this section, we portray a greater amount of MATLAB's illustrations graphic functions and the most well-known methods of controlling and redoing graphics. Let’s type help designs, help graph2d (for...

7 minutes read.

MATLAB Commands

MATLAB Commands MATLAB (stands for matrix laboratory) is a high-level programming environment for scientific calculation, and it provides functions more efficiently than other programming languages. In addition, it has many in-build...

3 minutes read.