how can i answer how to plot signal, and its frequency and phase. Then add a noise signal and plot the same parameters?
1 view (last 30 days)
Show older comments
NOR AZRIE NORZARI
on 14 Oct 2019
Commented: NOR AZRIE NORZARI
on 14 Oct 2019
Given V1 = 2cos(2π(10)t + 1.5π) + 6 cos(2π(30)t) + 5 cos (2π)t + π)
0 Comments
Accepted Answer
Jon
on 14 Oct 2019
Edited: Jon
on 14 Oct 2019
Here are some ideas to get you started
If you just want to visualize V1 as a function of time you can assign a vector of values for over the range of interest,
for example using
tfinal = 10; % or what ever you choose as your final time
t = linspace(0, tfinal)
Then write an expression evaluating v1 for each value of t, something like (
v1 = 2*cos(2*pi*10*t + 1.5*pi) + t*cos(...% I think you can follow from there
And then you can use the plot command.
plot(t,v1)
You can add random noise to the signal using something like (variable names are up to you)
noiseMagnitude = 20; % or whatever value you choose for how "big" the noise is
v1Noisy = v1 + noiseMagnitude*randn(size(t))
and then plot that again using the plot command, you could also plot both the original and noisy signal at the same time using
plot(t,v1,t,v1Noisy)
I'm not quite sure what you mean by plotting the frequency and phase, but sounds like you may want to investigate the use of the fft command to do a fourier transform analysis (although you can also determine it analytically from the function you are given)
That should get you started. If you are still stuck after you have tried to code this, then please attach your code, and clearly state what problem you are having. Copy and paste the full text of any error messages you are receiving if that is where you are stuck.
For future postings it is better to just briefly describe the problem you are having in the subject line and then ask the question in the body
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!