<< Chapter < Page Chapter >> Page >

This lab involves experimenting with the convolution of two continuous-time signals. The main mathematical part is written as a .m file, which is then used as a LabVIEW MathScript node within the LabVIEW programming environment to gain user interactivity. Due to the discrete-time nature of programming, an approximation of the convolution integral is needed. As an application of the convolution concept, echoes are removed from speech recordings using this concept.

Numerical approximation of convolution

In this section, let us apply the LabVIEW MathScript function conv to compute the convolution of two signals. One can choose various values of the time interval Δ size 12{Δ} {} to compute numerical approximations to the convolution integral.

Convolution example 1

In this example, use the function conv to compute the convolution of the signals x ( t ) = exp ( at ) u ( t ) size 12{x \( t \) ="exp" \( - ital "at" \) u \( t \) } {} and h ( t ) = exp ( bt ) u ( t ) size 12{h \( t \) ="exp" \( - ital "bt" \) u \( t \) } {} with u ( t ) size 12{u \( t \) } {} representing a step function starting at 0 for 0 t 8 size 12{0<= t<= 8} {} . Consider the following values of the approximation pulse width or delta: Δ = 0 . 5, 0 . 1, 0 . 05 , 0 . 01 , 0 . 005 , 0 . 001 size 12{Δ=0 "." 5,`0 "." 1,`0 "." "05",`0 "." "01",`0 "." "005",`0 "." "001"} {} . Mathematically, the convolution of h ( t ) size 12{h \( t \) } {} and x ( t ) size 12{x \( t \) } {} is given by

y ( t ) = 1 a b ( e bt e at ) u ( t ) size 12{y \( t \) = { {1} over {a - b} } \( e rSup { size 8{ - ital "bt"} } - e rSup { size 8{ - ital "at"} } \) u \( t \) } {}

Compare the approximation y ˆ ( ) size 12{ { hat {y}} \( nΔ \) } {} obtained via the function conv with the theoretical value y ( t ) size 12{y \( t \) } {} given by Equation (1). To better see the difference between the approximated y ˆ ( ) size 12{ { hat {y}} \( nΔ \) } {} and the true y ˆ ( ) size 12{ { hat {y}} \( nΔ \) } {} values, display y ˆ ( t ) size 12{ { hat {y}} \( t \) } {} and y ( t ) size 12{y \( t \) } {} in the same graph.

Compute the mean squared error (MSE) between the true and approximated values using the following equation:

MSE = 1 N n = 1 N ( y ( ) y ˆ ( ) ) 2 size 12{ ital "MSE"= { {1} over {N} } Sum cSub { size 8{n=1} } cSup { size 8{N} } { \( y \( nΔ \) - { hat {y}} \( nΔ \) \) rSup { size 8{2} } } } {}

where N = T Δ size 12{N= left lfloor { {T} over {Δ} } right rfloor } {} , T is an adjustable time duration expressed in seconds and the symbol . size 12{ left lfloor "." right rfloor } {} denotes the nearest integer. To begin with, set T = 8 size 12{T=8} {} .

As you can see here, the main program is written as a .m file and placed inside LabVIEW as a LabVIEW MathScript node by invoking Functions Programming Structures MathScript . The .m file can be typed in or copied and pasted into the LabVIEW MathScript node. The inputs to this program consist of an approximation pulse width Δ size 12{Δ} {} , input exponent powers a size 12{a} {} and b size 12{b} {} and a desired time duration T size 12{T} {} . To add these inputs, right-click on the border of the LabVIEW MathScript node and click on the Add Input option as shown in [link] .

(a) Adding Inputs, (b) Creating Controls

After adding these inputs, create controls to allow one to alter the inputs interactively via the front panel. By right-clicking on the border, add the outputs in a similar manner. An important consideration is the selection of the output data type. Set the outputs to consist of MSE, actual or true convolution output y_ac and approximated convolution output y. The first output is a scalar quantity while the other two are one-dimensional vectors. The output data types should be specified by right-clicking on the outputs and selecting the Choose Data Type option (see [link] ).

(a) Adding Outputs, (b) Choosing Data Types

Next write the following .m file textual code inside the LabVIEW MathScript node:

t=0:Delta:8;

Lt=length(t);

x1=exp(-a*t);

x2=exp(-b*t);

y=Delta*conv(x1,x2);

y_ac=1/(a-b)*(exp(-b*t)-exp(-a*t));

MSE=sum((y(1:Lt)-y_ac).^2)/Lt

Questions & Answers

what is defense mechanism
Chinaza Reply
what is defense mechanisms
Chinaza
I'm interested in biological psychology and cognitive psychology
Tanya Reply
what does preconceived mean
sammie Reply
physiological Psychology
Nwosu Reply
How can I develope my cognitive domain
Amanyire Reply
why is communication effective
Dakolo Reply
Communication is effective because it allows individuals to share ideas, thoughts, and information with others.
effective communication can lead to improved outcomes in various settings, including personal relationships, business environments, and educational settings. By communicating effectively, individuals can negotiate effectively, solve problems collaboratively, and work towards common goals.
it starts up serve and return practice/assessments.it helps find voice talking therapy also assessments through relaxed conversation.
miss
Every time someone flushes a toilet in the apartment building, the person begins to jumb back automatically after hearing the flush, before the water temperature changes. Identify the types of learning, if it is classical conditioning identify the NS, UCS, CS and CR. If it is operant conditioning, identify the type of consequence positive reinforcement, negative reinforcement or punishment
Wekolamo Reply
please i need answer
Wekolamo
because it helps many people around the world to understand how to interact with other people and understand them well, for example at work (job).
Manix Reply
Agreed 👍 There are many parts of our brains and behaviors, we really need to get to know. Blessings for everyone and happy Sunday!
ARC
A child is a member of community not society elucidate ?
JESSY Reply
Isn't practices worldwide, be it psychology, be it science. isn't much just a false belief of control over something the mind cannot truly comprehend?
Simon Reply
compare and contrast skinner's perspective on personality development on freud
namakula Reply
Skinner skipped the whole unconscious phenomenon and rather emphasized on classical conditioning
war
explain how nature and nurture affect the development and later the productivity of an individual.
Amesalu Reply
nature is an hereditary factor while nurture is an environmental factor which constitute an individual personality. so if an individual's parent has a deviant behavior and was also brought up in an deviant environment, observation of the behavior and the inborn trait we make the individual deviant.
Samuel
I am taking this course because I am hoping that I could somehow learn more about my chosen field of interest and due to the fact that being a PsyD really ignites my passion as an individual the more I hope to learn about developing and literally explore the complexity of my critical thinking skills
Zyryn Reply
good👍
Jonathan
and having a good philosophy of the world is like a sandwich and a peanut butter 👍
Jonathan
generally amnesi how long yrs memory loss
Kelu Reply
interpersonal relationships
Abdulfatai Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, An interactive approach to signals and systems laboratory. OpenStax CNX. Sep 06, 2012 Download for free at http://cnx.org/content/col10667/1.14
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'An interactive approach to signals and systems laboratory' conversation and receive update notifications?

Ask