cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Remove specific regions from a graph

HI_10746904
1-Newbie

Remove specific regions from a graph

Hello,

 

I read an excel file into MathCAD and created a matrix and was able to plot the figure. The data is current through a switch. I want to delete specific regions of the graph, namely some spikes (see attached file). 

 

Is there a way to do this? 

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

You must keep the points on the graphs in synchronization if you want to do arithmetic on them element by element

Capture.JPG

Capture2.JPG

If so is there a way reflect the modifications done on the curve on the data?

Yes you can plot the points taken out in a different colour on the plots.

Cheers

Terry

View solution in original post

22 REPLIES 22

Hi,

Can you please upload the Prime file (and Excel file if required) with the data

Cheers

Terry

Hi Terry,

 

Attached is the Excel file and MathCAD 

 

Thanks,

 

Hi,

First process is trim the tops

Capture.JPG

Cheers

Terry

Thanks! is there a way to remove the spikes between the peaks? 

Hi,

Working on it

Cheers

Terry

Hi

As requested.

Capture.JPG

Thanks a lot for the help! one last thing, if I want to do the same for the bottom of the curve should I follow the same steps you did ? 

Also is it possible to multiply two plots together? for example, this modified plot with a voltage plot and then get the averaged value? 

 

Thanks again for your quick responses. I attached an example voltage data for reference. 

 

 

if I want to do the same for the bottom of the curve should I follow the same steps you did ? 

Yes

Also is it possible to multiply two plots together?

Once you have trimmed the data it is no longer possible to relate the points on the graph from one plot to the other.  It is possible to (before any trimming) use the one to one correspondence of two data sets to multiply them.  Use the vectorization element by element operations to use two vectors.

Capture.JPG

 

Cheers

Terry

 

So just to confirm, I can't do mathematical operations with the new modified plot i.e. multiplying to another plot right? If so is there a way reflect the modifications done on the curve on the data?  

 

Thanks

Hi,

You must keep the points on the graphs in synchronization if you want to do arithmetic on them element by element

Capture.JPG

Capture2.JPG

If so is there a way reflect the modifications done on the curve on the data?

Yes you can plot the points taken out in a different colour on the plots.

Cheers

Terry

ttokoro
20-Turquoise
(To:HI_10746904)

Average data and its spetrum.

image.pngimage.png

Thanks,

 

I am fairly new to MathCAD. How do you find the average for a full matrix? and how do you multiply the B plot with another plot then get the average?

 

Thanks again  

Capture.JPG

simply find the mean with the mean() statistical function.

for the multiplication of B and C you must use a element by element multiplication with the arrow vectorize operator.

 

Cheers

Terry

Thanks,

 

But can you plot the multiplied average? 

 

for example: If I modified B and called it Bm. And imported another wave and assigned it to C. Now I want to multiply Bm with C and plot the result then plot the average.  

 

Is this possible to do? Because the current issue is that the Matrices are no longer equal, they have different dimensions.

 

Hi

for example: If I modified B and called it Bm. And imported another wave and assigned it to C. Now I want to multiply Bm with C and plot the result

OK You have many vectors..  All the same length. One of the vectors "X1" is the abscissa to both the ordinate vectors Y1 and Y2.  You can plot Y1 and Y2 against X..  Make a fourth vector Y3 by multiplying element by element Y1 and Y2.  You can plot Y3 against X1.   If you want to filter or trim data you need to keep abscissa/ordinate pairs with the same trims.  This keeps the vectors the same length for the plots.  Whatever you trim for Y1 you need to trim  X1.  Whatever you trim Y2 you need to trim X2.   If the trims for Y1,X1 are different to the trims for Y2,X2 you cannot multiply vectors Y1*Y2 element by element or plot against X1  as they may be vectors of different lengths by the different trim processes.

Capture.JPG

 

then plot the average

Use a small 2 element vector for the x dimensions from min to max of X1 and a small two element vector containing the mean of Y! repeated and plot the two small vectors.  A line appears on the graph.

 

Cheers 

Terry

Thanks Terry for your help. 

 

I think maybe another possible way is to first multiply the Id and Vds then remove the spikes using the first method you provided right? This way I can avoid having different vectors and try to multiply them. Instead I will have a new plot and trim the spikes from it then I can average it.

 

Thanks again

Hi,

Way to go.

Cheers

Terry

Hello,

 

I followed the same steps with the multiplied waves but the values are not cancelling out properly. I attached the modifications I made, it would be helpful

if you can point out what I am doing wrong.

 

Thanks again for all the help.

Hi,

It is really late at night in my part of the world will have a look in the morning

Cheers

Terry

No problem, I think I found the issue. I think it was the location I had placed the graph at, it was before I made the calculations.  Now I am trying to do the same but for the bottom spikes, that aren't as big as the ones on the top, but facing some issues. I reversed what you did for the top part but that is showing wrong waves. 

 

Would appreciate any guidance for that.

 

Thanks

 

 

Hi,

Have tweaked the top wave function.

The position of the graph was a problem.

 

I've been trying to figure out how to trim out the "bad data."  I started out trying (and failing miserably) to develop an FFT  based solution.  

 

That led me to looking at the time data, and there are some really strange things to be seen.  Take a look at the attached file.

Top Tags