Reading Binary File Format with complex integer and integer
13 次查看(过去 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!