3dtof / voxelsdk

VoxelSDK - an SDK supporting TI's 3D Time of Flight cameras
BSD 3-Clause "New" or "Revised" License
107 stars 71 forks source link

About parameter "phase_corr_1" #16

Closed Yorkland closed 9 years ago

Yorkland commented 9 years ago

I saw the following explanations in VoxelCLI's help, "phase_corr_1: Phase correction for base frequency. This value is substracted from the obtained phase."

And the range is from -2,048 to 2,047,

My question is if this offset is caused by signal processing, Why the range includes positive and negative? Or I should ask under what condition? the value will be positive and what condition causes negative?

bharathpatil commented 9 years ago

This offset is caused by the difference in path delays between illumination driver and demodulation driver. It could be positive or negative. Also, sometimes the difference in delays could be greater than half the modulation time period causing the difference to appear negative. The number is a represented in 2's complement form.

Yorkland commented 9 years ago

Actually, I met some problem. The following content is my setting in "conf" file. shortrangeconf The test steps include,

  1. Make Voxel-D to monitor a white-wall far from 25cm and 30cm.
  2. Save "raw" data from "CLIManager.exe",
  3. Got the average 10X10 pixels around center point (160, 120),
  4. Phase = 3,896 in 25cm, and 3,983 in 30cm, the phase value is quite big than my forecast.

In this case, the mod_freq = 24MHz, C/2F = 6.25 meter, decode by 2^12 = 4096, Phase in 25cm, should be 4,096 / 6.25 * 0.25 = 150 (we got in raw is 3,896) Phase in 30cm, should be 4,096 / 6.25 * 0.30 = 197 (we got in raw is 3,983)

Depending on the value we got, "phase_corr_1" must be set to 3,732 (3,896 - 150 = 3,732) at least. But as we knew, the range of "phase_corr_1" is -2,048 to 2,047.

No matter I set phase_corr_1 = -2,048 or 2,047, the point cloud looks quite "FLAT". I think I got something wrong in the setting.

gadiyar commented 9 years ago

Phase wraps at 4096. So you can set phase_corr_1 to -394 (=3732-4096) instead.

Yorkland commented 9 years ago

Thanks, I will try -394 tomorrow. But, the raw phase is up to 3,896 (25cm) ~ 3,983(30cm), That's to say, when the distance is longer than 37cm, the phase will be over the limit 4096. Is it normal? Originally, I consider the wrap occur at the distance over C/2F only.

gadiyar commented 9 years ago

It is normal that the phase does not start at 0, due to the offsets in the system. After setting a proper phase offset in phase_corr_1, the next wrap is at the distance corresponding to (C/2F).

Yorkland commented 9 years ago

Cool, thanks again.