Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The instructions are to create a function named add_sines which would add mutiple signals into one and the hints are given as shown, we are

The instructions are to create a function named add_sines which would add mutiple signals into one and the hints are given as shown, we are not allowed to used for loops or any type of loops image text in transcribed
function [xx,tt] = add_sines(freqs, Camps, dur, tstart) XADD_SINES Synthesize a signal from sum of complex exponentials % usage: % [xx, tt) = add_sines(freqs, Camps, dur, tstart) % freqs vector of frequencies (usually none are negative) % Camps = vector of COMPLEX amplitudes % dur = total time duration of the signal % tstart = starting time % xx - vector of sinusoidal values % tt = vector of times, for the time axis % % Note: freqs and Camps must be the same length. % Camps (1) corresponds to frequency freqs(1). Camps (2) corresponds to frequency freqs(2), etc, % The tt vector should be generated with a small time increment that creates 32 samples for the shortest period, i.e., use the period corresponding to the highest frequency in the freqs vector. The MATLAB syntax length(freqs) returns the number of elements in the vector freqs, so we do not need a separate input argument for the number of frequencies. On the other hand, it is good programming practice to provide error checking to make sure that the lengths of the vectors freqs and Camps are the same. See function [xx,tt] = add_sines(freqs, Camps, dur, tstart) XADD_SINES Synthesize a signal from sum of complex exponentials % usage: % [xx, tt) = add_sines(freqs, Camps, dur, tstart) % freqs vector of frequencies (usually none are negative) % Camps = vector of COMPLEX amplitudes % dur = total time duration of the signal % tstart = starting time % xx - vector of sinusoidal values % tt = vector of times, for the time axis % % Note: freqs and Camps must be the same length. % Camps (1) corresponds to frequency freqs(1). Camps (2) corresponds to frequency freqs(2), etc, % The tt vector should be generated with a small time increment that creates 32 samples for the shortest period, i.e., use the period corresponding to the highest frequency in the freqs vector. The MATLAB syntax length(freqs) returns the number of elements in the vector freqs, so we do not need a separate input argument for the number of frequencies. On the other hand, it is good programming practice to provide error checking to make sure that the lengths of the vectors freqs and Camps are the same. See

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions