Problem 3: Write the function convolve that will calculate the confolution of two functions f, g on [0, t] interval. The convolution is defined as (f*g)(t) = f* f(r)g(t−7) dr__for f,g: (0,00) → R. The argument function f and g should be passed by pointers. The integral should be approxi- mated by the Riemman sum, i.e., ● f = sin(x), g = = sin(x) where Ax = ba and x₁ = a +i Ax. Define the functions func1, func2 and func3, that return n sin(x), cos(x) and ³ respectively. Use these functions to calculate the convolution of f = sin(x), g = ● = cos(x) f = sin(x), g = x³ for t27 and n = 1000. cb [ f(x) d a n ƒ (x) dx = ➤ ƒ (x₁) Ax, -£fa i=1

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 8SA
icon
Related questions
Question

Language: C

Write the function convolve that will calculate the confolution of two functions f, g on [0, t] interval. The convolution is defined as (f ∗ g)(t) = Z t 0 f(τ )g(t − τ ) dτ for f, g : [0, ∞) → R. The argument function f and g should be passed by pointers. The integral should be approximated by the Riemman sum, i.e., Z b a f(x) dx = Xn i=1 f(xi) ∆x, where ∆x = b−a n and xi = a + i ∆x. Define the functions func1, func2 and func3, that return sin(x), cos(x) and x 3 respectively. Use these functions to calculate the convolution of ˆ f = sin(x), g = sin(x) ˆ f = sin(x), g = cos(x) ˆ f = sin(x), g = x 3 for t = 2π and n = 1000.

Problem 3:
Write the function convolve that will calculate the confolution of two functions f, g on [0, t]
interval.
The convolution is defined as
f(r)g(t – T) dr
The argument function f and g should be passed by pointers. The integral should be approxi-
mated by the Riemman sum, i.e.,
f = sin(x), g
sin(x)
●
f = sin(x), g = cos(x)
(f + g)(t) =
*
●
b-a
where Ax=
and x₁ = a +i Ax. Define the functions func1, func2 and func3, that return
sin(x), cos(x) and x³ respectively. Use these functions to calculate the convolution of
n
=
t
f = sin(x), g = x³
for t= 27 and n = 1000.
for f, g [0, ∞) → R.
:
·b
n
[ f(x) dx = f(xi) Ax,
a
i=1
Transcribed Image Text:Problem 3: Write the function convolve that will calculate the confolution of two functions f, g on [0, t] interval. The convolution is defined as f(r)g(t – T) dr The argument function f and g should be passed by pointers. The integral should be approxi- mated by the Riemman sum, i.e., f = sin(x), g sin(x) ● f = sin(x), g = cos(x) (f + g)(t) = * ● b-a where Ax= and x₁ = a +i Ax. Define the functions func1, func2 and func3, that return sin(x), cos(x) and x³ respectively. Use these functions to calculate the convolution of n = t f = sin(x), g = x³ for t= 27 and n = 1000. for f, g [0, ∞) → R. : ·b n [ f(x) dx = f(xi) Ax, a i=1
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 7 steps with 2 images

Blurred answer
Knowledge Booster
Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning