Precision Issue in adding very small fractions of seconds to datenum
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello All:
I am trying to plot a .wav file audio signature with 'true time of recording' on the x-axis. My ideas was to use datenum, and the datetick to achieve this. But I ran into problems pretty early.
The file is coded at 14kHz, and is exactly 1 minute long. So audioread gives me 14000*60=840000 points. So the time 'relative to the wav file' runs from t=0 to t=60 seconds in steps of 1/14000 second.
I am then trying to use datenum to add 'true' time to the above. The actual time of recording is 05-March-2013 14:00:00 hrs. For simplicity, lets say it was 05-March-2013 00:00:00 hrs.
05-March-2013 00:00:00 is 735298. Call it 'a'. 1 second on top of this is 1/86400. The fraction of second I am dealing with is 1/14000. So fraction in 'datenum' terms is 1/14000/86400. Call it 'b'.
If I add 1/14000th of a second to the date, I already have 735298.0000000008267195767195768 which runs out of precision.
What can I do?
My ultimate aim is to achieve the audio signature of 'y' axis and 'actual date & time' on x-axis.
Thanks all for your attention. Any help will be highly appreciated.
댓글 수: 5
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Measurements and Spatial Audio에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!