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 Control Statements

What are control statements? The name itself suggests that something is being controlled, these control statements decide or alter the flow of execution ina program. In program, we often need to...

3 minutes read.

matlab polynomials

In mathematics, a polynomial is an articulation comprising of indeterminates factors and the respective coefficients, that includes just the tasks of augmentation, expansion, deduction, and non-negative whole number exponentiation of...

4 minutes read.

Matlab DFT and IDFT

Matlab Program- (DFT and IDFT of a sequence) Program for DFT (Discrete Fourier change) and IDFT (Inverse discrete Fourier change) of a sequence. Program explanation: In Arithmetic, the discrete Fourier change (DFT) changes...

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 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 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 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 Algebra

Up until now, we have seen that every one of the models work in MATLAB just as its GNU, then again called Octave. In any case, for addressing fundamental mathematical...

6 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 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 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 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.

MATLAB Program - To Solve Differential Equation Using Euler’s Method

Using Euler's method to solve differential equation Can you imagine a point where we do not use differential equation to solve differential condition? Truth be told, there are a few different...

3 minutes read.

MATLAB Data types

What is Data Type? A data type is a classification that helps to decide what class of value a variable can reserve in programming. And also, what sort of operations can...

6 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 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 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 Butterworth filter

What is Butterworth filter? The Butterworth channel is a kind of sign preparing channel intended to have a recurrence reaction as level as conceivable in the passband. It is likewise alluded...

3 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.