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!