##// END OF EJS Templates
Bug 978 Mauvais nombre de FFT retiré lors du filtrage PAS
paul -
r350:d301b368f883 R3++ draft
parent child
Show More
@@ -1,2 +1,2
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
2 21ada91882790323b08a38518ed1af5a36fa4deb header/lfr_common_headers
2 f97721719ddb7e088956d5fd3cffb0f9587a041b header/lfr_common_headers
@@ -720,7 +720,8 int getFBinMask( int index, unsigned cha
720
720
721 unsigned char acquisitionTimeIsValid( unsigned int coarseTime, unsigned int fineTime, unsigned char channel)
721 unsigned char acquisitionTimeIsValid( unsigned int coarseTime, unsigned int fineTime, unsigned char channel)
722 {
722 {
723 u_int64_t acquisitionTime;
723 u_int64_t acquisitionTimeStart;
724 u_int64_t acquisitionTimeStop;
724 u_int64_t timecodeReference;
725 u_int64_t timecodeReference;
725 u_int64_t offsetInFineTime;
726 u_int64_t offsetInFineTime;
726 u_int64_t shiftInFineTime;
727 u_int64_t shiftInFineTime;
@@ -734,8 +735,20 unsigned char acquisitionTimeIsValid( un
734 ret = 1;
735 ret = 1;
735
736
736 // compute acquisition time from caoarseTime and fineTime
737 // compute acquisition time from caoarseTime and fineTime
737 acquisitionTime = ( ((u_int64_t)coarseTime) << SHIFT_2_BYTES )
738 acquisitionTimeStart = ( ((u_int64_t)coarseTime) << SHIFT_2_BYTES )
738 + (u_int64_t) fineTime;
739 + (u_int64_t) fineTime;
740 switch(channel)
741 {
742 case CHANNELF0:
743 acquisitionTimeStop = acquisitionTimeStart + FINETIME_PER_SM_F0;
744 break;
745 case CHANNELF1:
746 acquisitionTimeStop = acquisitionTimeStart + FINETIME_PER_SM_F1;
747 break;
748 case CHANNELF2:
749 acquisitionTimeStop = acquisitionTimeStart + FINETIME_PER_SM_F2;
750 break;
751 }
739
752
740 // compute the timecode reference
753 // compute the timecode reference
741 timecodeReference = (u_int64_t) ( (floor( ((double) coarseTime) / ((double) filterPar.sy_lfr_pas_filter_modulus) )
754 timecodeReference = (u_int64_t) ( (floor( ((double) coarseTime) / ((double) filterPar.sy_lfr_pas_filter_modulus) )
@@ -757,8 +770,8 unsigned char acquisitionTimeIsValid( un
757 + shiftInFineTime
770 + shiftInFineTime
758 + tBadInFineTime;
771 + tBadInFineTime;
759
772
760 if ( (acquisitionTime >= acquisitionTimeRangeMin)
773 if ( (acquisitionTimeStart >= acquisitionTimeRangeMin)
761 && (acquisitionTime <= acquisitionTimeRangeMax)
774 && (acquisitionTimeStart <= acquisitionTimeRangeMax)
762 && (pasFilteringIsEnabled == 1) )
775 && (pasFilteringIsEnabled == 1) )
763 {
776 {
764 ret = 0; // the acquisition time is INSIDE the range, the matrix shall be ignored
777 ret = 0; // the acquisition time is INSIDE the range, the matrix shall be ignored
@@ -768,6 +781,21 unsigned char acquisitionTimeIsValid( un
768 ret = 1; // the acquisition time is OUTSIDE the range, the matrix can be used for the averaging
781 ret = 1; // the acquisition time is OUTSIDE the range, the matrix can be used for the averaging
769 }
782 }
770
783
784 // the last sample of the data used to compute the matrix shall not be INSIDE the range, test it now, it depends on the channel
785 if (ret == 1)
786 {
787 if ( (acquisitionTimeStop >= acquisitionTimeRangeMin)
788 && (acquisitionTimeStop <= acquisitionTimeRangeMax)
789 && (pasFilteringIsEnabled == 1) )
790 {
791 ret = 0; // the acquisition time is INSIDE the range, the matrix shall be ignored
792 }
793 else
794 {
795 ret = 1; // the acquisition time is OUTSIDE the range, the matrix can be used for the averaging
796 }
797 }
798
771 // printf("coarseTime = %x, fineTime = %x\n",
799 // printf("coarseTime = %x, fineTime = %x\n",
772 // coarseTime,
800 // coarseTime,
773 // fineTime);
801 // fineTime);
General Comments 0
You need to be logged in to leave comments. Login now