I have a project (software) in which I want to look at two ~100KHz signals, and compute the phase difference. I'm using a 2205A, so the bandwidth isn't a problem.

I understand how to set each channel, and the trigger. But I am unsure how to collect a block of data. Do I use two statements? ((EDIT: no, found answer here for others topic35811.html?&view=unread#unread))If so, isn't there going to be an unknown phase shift introduced into the data? Should I do this in streaming mode instead? Just starting to work on this, so more questions than answers

Assuming I can do this, maybe you could outline the suggested steps?

This is a pretty critical phase measurement in a production level test, so it must be accurate, although I can't give you an accuracy number right now. How close can I get?

Thanks.

## phase detection

### Re: phase detection

Hi TimOster,

This has already been answered on our forum here: topic10569.html, with an updated version here: post110681.html?hilit=phase%20difference#p110681 which is more accurate but has some associated caveats.

Regards,

Gerry

This has already been answered on our forum here: topic10569.html, with an updated version here: post110681.html?hilit=phase%20difference#p110681 which is more accurate but has some associated caveats.

Regards,

Gerry

Gerry

Technical Specialist

Technical Specialist

### Re: phase detection

Thank you, but I'm talking about in vb.net code. Not the PicoScope 6 software.

### Re: phase detection

Hi TimOster,

Sorry I should have made that clearer. I was focusing more on the 'what you can expect' part of your query, as that is an essential starting point.

Unfortunately we don't have any data to give you an idea of what to expect. However, the PicoScope 2205A is an entry level PicoScope, and isn't going to have the performance of our more mainstream PicoScopes, so it may not be a Scope that will meet your measurement requirements, which is why you need to match it's capability to your expectation before getting into the specifics of how you're going to make the measurement more accurate (or, as you're measuring the difference between 2 values, how you're going to make the measurement more precise). That said, the frequencies of the 2 signals are relatively slow so you should be able to get quite high precision (it just depends upon exactly how high you need it to be).

The issue is whether or not the precision with which you want to measure the phase difference is better than the smallest phase difference that the PicoScope 2205A will measure. The precision with which the 2205A can make measurements will be limited by the uncertainty caused by the variation in phase difference from measurement to measurement. So, you will need to perform a number of captures to get the statistical data required to find out what the uncertainty of the measurement is. Using PicoScope 6 and maths channels as a starting point will give you the ability to perform some quick measurements so that you can see if you'd be wasting your time using a more complicated method in search of high precision, if that is what you need. Alternatively, the uncertainty may be barely detectable (in which case the precision of the 2205A is at least as good as the accuracy of the Maths channel calculation, and using higher accuracy methods would be justified, once again, if that's what you need).

Assuming that you're using sinusoids, if you are happy with the precision then you can just use the Math library of VB.net to perform the same calculation as the Math Channel on the 2 buffers of data that you have gathered from the call-back function, and then take the value when it drops below a minimum amount of change.

To answer your remaining (I think) questions, the data will be captured simultaneously on active channels. So, if you are capturing single blocks of data (by using ps2000_stop() once the capture is complete) then for each capture there will be an, unknown phase shift between the trigger and a predetermined point on a captured waveform, and all points that correspond in time on the other waveform/s captured for the other active channel/s will have the same phase shift so it won't affect the phase difference between channels.

If you decide that you need higher precision measurement, I can give you a method for higher precision, which involves looking for comparable points on the 2 wave-forms, to measure the distance between them, as the mean of a multipe measurements.

Regards,

Gerry

Sorry I should have made that clearer. I was focusing more on the 'what you can expect' part of your query, as that is an essential starting point.

Unfortunately we don't have any data to give you an idea of what to expect. However, the PicoScope 2205A is an entry level PicoScope, and isn't going to have the performance of our more mainstream PicoScopes, so it may not be a Scope that will meet your measurement requirements, which is why you need to match it's capability to your expectation before getting into the specifics of how you're going to make the measurement more accurate (or, as you're measuring the difference between 2 values, how you're going to make the measurement more precise). That said, the frequencies of the 2 signals are relatively slow so you should be able to get quite high precision (it just depends upon exactly how high you need it to be).

The issue is whether or not the precision with which you want to measure the phase difference is better than the smallest phase difference that the PicoScope 2205A will measure. The precision with which the 2205A can make measurements will be limited by the uncertainty caused by the variation in phase difference from measurement to measurement. So, you will need to perform a number of captures to get the statistical data required to find out what the uncertainty of the measurement is. Using PicoScope 6 and maths channels as a starting point will give you the ability to perform some quick measurements so that you can see if you'd be wasting your time using a more complicated method in search of high precision, if that is what you need. Alternatively, the uncertainty may be barely detectable (in which case the precision of the 2205A is at least as good as the accuracy of the Maths channel calculation, and using higher accuracy methods would be justified, once again, if that's what you need).

Assuming that you're using sinusoids, if you are happy with the precision then you can just use the Math library of VB.net to perform the same calculation as the Math Channel on the 2 buffers of data that you have gathered from the call-back function, and then take the value when it drops below a minimum amount of change.

To answer your remaining (I think) questions, the data will be captured simultaneously on active channels. So, if you are capturing single blocks of data (by using ps2000_stop() once the capture is complete) then for each capture there will be an, unknown phase shift between the trigger and a predetermined point on a captured waveform, and all points that correspond in time on the other waveform/s captured for the other active channel/s will have the same phase shift so it won't affect the phase difference between channels.

If you decide that you need higher precision measurement, I can give you a method for higher precision, which involves looking for comparable points on the 2 wave-forms, to measure the distance between them, as the mean of a multipe measurements.

Regards,

Gerry

Gerry

Technical Specialist

Technical Specialist

### Re: phase detection

Thanks. Since both channels are "lined" up in time, I have a simple sub to find the index at a peak. I can just look at the distance (in time) between them and see the period. Knowing the freq I can infer the phase.

Tim

Tim