Skip to main content
19-Tanzanite
April 18, 2023
Solved

How can I extend a signal defined in a finite range to be periodic?

  • April 18, 2023
  • 3 replies
  • 4916 views

Hello,

 

CornelBejan_0-1681808493280.png

CornelBejan_1-1681808502423.png

 

 

CornelBejan_2-1681808597268.png????

 

How can I extend the above x(t,...) signal which is defined from -pi to pi to a periodic one so that I can display more periods of the signal, as it is shown below?

 

CornelBejan_3-1681808645707.png

 

Mathcad Prime 8 file attached.

 

Thank you.

 

 

Best answer by Werner_E

How can I extend the above x(t,...) signal which is defined from -pi to pi to a periodic one so that I can display more periods of the signal, as it is shown below?

If its just for displaying the graph, here are a few ways to turn a piece of a function periodic.

I created utility functions which expect a function with just one argument.

The first way uses the floor function

Werner_E_0-1681819824394.png

 

Another possibility would be to use the mod function. Because its implemented in Prime in a way to return negative values for negative arguments (which is undesirable here), I used it twice, adding the period for the second time to be sure to avoid negative values.

Werner_E_1-1681819986222.png

 

You may also use a recursive approach, but I would not suggest doing so

Werner_E_2-1681820079357.png

You could achieve the same effect as in the recursive approach by using a while loop

Werner_E_3-1681820523434.png

 

Attached sheet is in Prime 9 format

 

 

 

 

3 replies

21-Topaz II
April 18, 2023

In the attached pdf, from page 12 onwards, there are numerous examples:

Cornel19-TanzaniteAuthor
19-Tanzanite
April 18, 2023

Ok. Thank you. But now I am interested in the extension of the periodicity to start from my function defined above (x(t,...)) and adapted in order to be able to display 2 periods, or 3 periods, etc.

21-Topaz II
April 18, 2023

Hi,

To plot the periodic function try this:

To plot one or more periods restrict the variable t to a given range.

Capture.JPG

Werner_E25-Diamond IAnswer
25-Diamond I
April 18, 2023

How can I extend the above x(t,...) signal which is defined from -pi to pi to a periodic one so that I can display more periods of the signal, as it is shown below?

If its just for displaying the graph, here are a few ways to turn a piece of a function periodic.

I created utility functions which expect a function with just one argument.

The first way uses the floor function

Werner_E_0-1681819824394.png

 

Another possibility would be to use the mod function. Because its implemented in Prime in a way to return negative values for negative arguments (which is undesirable here), I used it twice, adding the period for the second time to be sure to avoid negative values.

Werner_E_1-1681819986222.png

 

You may also use a recursive approach, but I would not suggest doing so

Werner_E_2-1681820079357.png

You could achieve the same effect as in the recursive approach by using a while loop

Werner_E_3-1681820523434.png

 

Attached sheet is in Prime 9 format

 

 

 

 

Cornel19-TanzaniteAuthor
19-Tanzanite
April 18, 2023

I do not have at this moment Mathcad Prime 9, but just Mathcad Prime 8. So, I cannot open Mathcad Prime 9 file. But I inserted the mkPer1 function you wrote.

 

CornelBejan_1-1681822125103.png

 

CornelBejan_2-1681822150179.png

CornelBejan_3-1681822159869.png

 

a) 

CornelBejan_4-1681822176711.png

 

 

CornelBejan_5-1681822185768.png

Here I do not know why signalp(t) shows these discontinuities.

 

b)

CornelBejan_6-1681822203205.png

CornelBejan_7-1681822209758.png

 

c)

CornelBejan_8-1681822223248.png

 

CornelBejan_9-1681822251443.png

 

Mathcad Prime 8 file attached.

 

 

25-Diamond I
April 18, 2023

@Cornel wrote:

I do not have at this moment Mathcad Prime 9, but just Mathcad Prime 8. 

 


That was the reason for the pictures I attached 😉

 


Here I do not know why signalp(t) shows these discontinuities.

 


Actually the signal IS NOT continuous. The vertical line segments which you seem to be missing would be incorrect from a mathematical point of view. But Prime omits these lines not because its so clever as we can see in the other examples.

Actually I don't know how plotting is implemented, so we can tell when vertical lines would be plotted and when not.

In my original file the verticals were missing when I used the quickplot feature but, as you could see in the picture, they were plotted when I defined a range for the abscissa values t.

When I opened your sheet and defined a range, nothing changed - the vertical lines still were not plotted.

I also tried modifying your function definition, but as you can see in the next pic, the vertical lines are still missing partially for the periodic signalp(t), but it IS drawn in the plot of signal(t),  The verticals are now drawn to connect the periodic parts, but not in the parts themselves. Can't explain why.

Werner_E_0-1681826487987.png

 

But then, the 2D plots in Prime have also other disadvantages and strange bugs (one is mentioned in my last picture). It sure isn't a masterpiece of programming.

21-Topaz II
April 18, 2023

It seems to me that you are looking for something like this (see photo) and open the attached file (for M15):

risposta a CornelBejan 2.jpg