10-02-2008 03:37 PM
10-02-2008 08:00 PM - edited 10-02-2008 08:10 PM
I don't know anything about MZI signals, but I do know sine waves. If this is a sine wave, it is relatively easy to measure its amplitude as long as you know the frequency. Since you say it is 10 MHz, you appear to know the frequency. You can use Fourier analysis to determine the magnitude and phase of your signal, as long is it is a steady signal that doesn't change frequency or amplitude.
Generate a sine and cosine wave using the same frequency. Divide each wave by the sum of its points. Multiply each one by your incoming signal and sum all the values, one sum for sine and one sum for cosine. The sums should be the coefficients of the sine and cosine components of your unknown signal. The ratio tells you the phase of the signal. If you multiply the sine and cosine waves by their coefficients and add them together, you should be very close to your incoming signal. The amplitude of your signal is equal to square root of A*A+B*B, where A and B are your coefficients.
I may be off by a constant factor here somewhere (probably pi), since I didn't write down the equations and verify them. These equations are the basis of the Fourier series, though, so they would be fairly easy to find.
Another option would be resampling. If you upsampled the data and increased the data resolution by a factor of 10 or so and filtered the results using an FIR filter, you would have a much cleaner signal with a lot more detail. You wouldn't have any problem locating and measuring peaks and valleys. This would probably work better with your data, since it looks like it doesn't have a constant magnitude. To upsample the data, just add 9 zeroes between each data point. Create a lowpass FIR filter that is based on 10 times the original sampling frequency and has an amplitude of 10. The cutoff frequency should be half the original sampling rate. Filter your new data and you should get the same waveform with 10 times the resolution.
Bruce
10-02-2008 08:30 PM
I found a function called Resample (constant to constant) in LV 8.6 that does exactly what you need. You input your original signal and the new spacing that you want (I used dt = 0.1) where dt = 1 is your original spacing. It does all the difficult work and gives you the resampled signal at the new resolution. You can try out different resampling rates and see what works best. It looks like a value of 0.2 or 0.25 would probably work well also. Larger values are probably a little bit faster.
Bruce
10-02-2008 10:48 PM
10-02-2008 11:05 PM
If you need to compare two signals, just use Resample to convert both of them. Any phase shift or magnitude change will be the same for both of them, so they will still match after the conversion. I think resampling will work very well.
You could also use Rational Resample, which uses integer resampling values. I found using values of 5, 1 to work very well.
Don't worry about the FIR filtering and all that stuff. That is all inside the Resample vi, and it does it all for you. Just run your signal through the Resample vi and you are done. Your new signal will have all the detail you need for your analysis.
Bruce