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
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
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.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 7 steps with 2 images
Knowledge Booster
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.Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning