Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this section, you will write a function called syn_sin.m that will synthesize a waveform from the vectors of frequencies and complex amplitudes. You must

In this section, you will write a function called syn_sin.m that will synthesize a waveform from the vectors of frequencies and complex amplitudes. You must write the function with one loop. Below is a template that you should base your solution on:

function [xx, tt] = syn_sin(fk, Xk, fs, dur, tstart) %{ syn_sin - Function to synthesize a sum of cosine waves. usage: [xx, tt] = syn_sin(fk, Xk, fs, dur, tstart) fk = vector of frequencies (could be negative or positive) Xk = vector of complex amplitudes: A*e^(j*phi) for each fk fs = the number of samples per second for the time axis dur = total time duration of the signal tstart = starting time (default is 0, if you make this input optional)

xx = vector of sinusoidal values tt = vector of times, for the time axis Note: fk and Xk must be the same length: Xk(1) corresponds to frequency fk(1), Xk(2) corresponds to frequency fk(2), etc.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ADD YOUR FUNCTION BODY HERE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ %

Here's a description in words: your function will take in two vectors of the same length: a vector of frequencies and a vector of phasors, along with numbers for sampling frequency fs, duration dur, and start time tstart. Adapt your code, from the one_cos function in your last lab, to now process these arguments, generate a sinusoid for each frequency and phasor in the two vectors and add them together.

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

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

Which are non projected Teaching aids in advance learning system?

Answered: 1 week ago

Question

=+Where does the focus of labor relations lie? Is it collective

Answered: 1 week ago

Question

=+With whom does the firm have to negotiate?

Answered: 1 week ago