The Wolf
The Wolf

Reputation: 57

Is this plot supposed to look this way?

enter image description here

We have this Continuous signal:

x(t)=cos(100*pi*t)+cos(200*pi*t)+sin(500*pi*t)  

and what we need to do is sample it and then reconstruct it. We made it in Matlab but it looks like a box and we are wondering if this is how it was supposed to look.

x = @(t) cos(100*pi*t)+cos(200*pi*t)+sin(500*pi*t);
t = -10:1/1000:10;
figure(1);
plot(t, x(t));
grid;

Upvotes: 1

Views: 66

Answers (1)

Orian Leitersdorf
Orian Leitersdorf

Reputation: 101

I recreated the plot on my MATLAB, and yes I saw the same "box" behavior. Notably, graphing the function on Desmos with this domain of [-10 10] also showed a similar "box".

I believe that the problem is originating from your choice of the domain ([-10 10]) which is causing the function to appear as a "box". For example, resizing to the following domain ([-0.05 0.05])

t = -0.05: 1/10000: 0.05;

produces this clearer plot:

plot produced with x domain of -0.05 to 0.05, the function no longer appears as a box and can be more clearly viewed

Upvotes: 1

Related Questions