How to do phase sensitive detection on data?

조회 수: 2 (최근 30일)
Pranjali Priyadarshini
Pranjali Priyadarshini 2015년 5월 1일
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개)

카테고리

Help CenterFile Exchange에서 PHY Components에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by