How to do phase sensitive detection on data?
2 次查看(过去 30 天)
显示 更早的评论
Hi, I have created a modulating fake spectra with three components A, B and C and added some noise to it. Now I want to do phase sensitive detection by using the formula 2/t*integral(A(t)*sin(f*t+phaseshift). I wrote the following code:
for j=1:1:L2 %Run demodulation routine for each phaseshift phaseshift=degtorad(ph(j));
for i = 1:1:L %Do demodulation at each wavenumber of the spectra
noisysigatonewav(:,i)=data1(i,:);%create vector with all measurements of given wavenumber as f(t) from row of original data
dm=noisysigatonewav(:,i)*sin((Fc*t)+phaseshift);
tempdemod=2*trapz(t,dm)/periodofdata1; %Demodulate using given values
tempdemoddata(i,:)=tempdemod; %write demodulated data to row of matrix
end
v=genvarname('demoddata', who); %create a new matrix for all the demodulated data for a given phase shift
eval([v '= tempdemoddata;'])%write all data from tempdemoddata to the new matrix for a given phase shift
end
So peaks due to A,B and C should vanish at different phaseshifts but in my code it is vanishing at the same value. Please advise me as to what is the problem with my code.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 PHY Components 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!