Reading Binary File Format with complex integer and integer

12 ビュー (過去 30 日間)
Dawid
Dawid 2011 年 3 月 29 日
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?

回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 3 月 29 日
This might be an application for memmapfile
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);

カテゴリ

Help Center および File ExchangeOctave についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by