Reading Binary File Format with complex integer and integer
조회 수: 12 (최근 30일)
이전 댓글 표시
The complex SAR image samples are stored as 16 bit / 16 bit complex integer (4 bytes). The byte order is big-endian (most significant byte first (MSB)) All annotation values are stored as 32 bit integer (4 bytes). The filler value is a 32 bit integer with a constant value of hex. 7f7f7f7f. That way, an annotation or filler value requires the same storage size as an image sample.
when I use
fid = fopen('IMAGE_HH_SRA_spot_074.cos', 'r', 'b');
m5 = fread(fid, [8367, 9506], '*uint');
I can get the annotation and filler values but image samples are also 32 bit. Can you help me how I can read 32 and 16 bit complex integer to get proper values?
댓글 수: 0
답변 (1개)
Walter Roberson
2011년 3월 29일
To split a uint32 into uint16 values,
m5s = typecast(m5(:),'uint16');
m5r = reshape(m5s(1:2:end),size(m5));
m5i = reshape(m5s(2:2:end),size(m5));
m5c = complex(m5r, m5i);
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Octave에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!