# hamming

【题目描述】

Hamming Codes
Rob Kolstad Given N, B, and D: Find a set of N codewords (1 <= N <= 64), each of length B bits (1 <= B <= 8), such that each of the codewords is at least Hamming distance of D (1 <= D <= 7) away from each of the other codewords. The Hamming distance between a pair of codewords is the number of binary bits that differ in their binary notation. Consider the two codewords 0x554 and 0x234 and their differences (0x554 means the hexadecimal number with hex digits 5, 5, and 4): 0x554 = 0101 0101 0100 0x234 = 0010 0011 0100 Bit differences: xxx xx Since five bits were different, the Hamming distance is 5. 【我的思路】 穷举一遍，直到达到个数。比较坑爹的是它要和之前输出的数都比较一遍，才能输出当前的 数，而且是汉明码大于等于 d 就可以。 【code】 { ID:yxy07015 PROG:hamming LANG:PASCAL } var n,m,d,s,num,i,j:integer; a:array[1..8] of integer; c:array[1..64,1..8] of integer; function check:boolean; var k:integer; begin for i:=1 to num do begin k:=0; for j:=1 to m do if a[j]<>c[i,j] then inc(k); if k<d then exit(false); end; exit(true); end; begin assign(input,'hamming.in'); reset(input); assign(output,'hamming.out'); rewrite(output);

readln(n,m,d); num:=1; s:=1; a[1]:=1; write('0 '); while num<n do begin if check then begin inc(num); c[num]:=a; if (num mod 10=0) or (num=n) then writeln(s) else write(s,' '); end; inc(a[1]); inc(s); for i:=1 to m do if a[i]>1 then begin dec(a[i],2); inc(a[i+1]); end; end; close(input); close(output); end.

Executing... Test 1: TEST OK [0.003 secs, 276 KB] Test 2: TEST OK [0.000 secs, 276 KB] Test 3: TEST OK [0.000 secs, 276 KB] Test 4: TEST OK [0.000 secs, 276 KB] Test 5: TEST OK [0.000 secs, 276 KB] Test 6: TEST OK [0.000 secs, 276 KB] Test 7: TEST OK [0.000 secs, 276 KB] Test 8: TEST OK [0.000 secs, 276 KB] Test 9: TEST OK [0.003 secs, 276 KB] Test 10: TEST OK [0.000 secs, 276 KB] Test 11: TEST OK [0.000 secs, 276 KB] All tests OK.

( '采用hanning和hamming设计的FIR-幅度响应'); subplot(2,1,2); plot( freq_norm,angle(H_hanning) ); hold on; xlabel( '归一化频率w/pi' ); ylabel...
Hamming网络运行过程
1 时,网络只能对模式进行精确匹配,此时网络没有容 2 确反映误差小于 Hamming 距离为 d 的模式。换句话说,网络能够把 离样本模式的 Hamming 距离在 d 内的模式...

window 是使用的窗函数,可以是 hamming、 hanning、 chebwin 等形式。 h 为产生的滤波器系数。详细说明可在 MATLAB 中输入 help fir1 或 doc fir1 查看。对产生...
Hamming distance
Simple String Comparison by Hamming Distance In string comparison problems, we are searching for similar strings, rather than exact matches. A simple ...
16交织编解码
1、汉明码和交织编码的编码组合实现 (1)端口设置 cs_hamming_in:输入汉明编码使能位,’1’电平有效; encodein_hamming_in:输入 2 组,每组 4 位编码输入位;...

(掌握) 矩形窗 Chebyshev 窗 hamming Hamming 窗(掌握) hanning Hanning 窗(掌握) kaiser Kaiser 窗(掌握) triang 三角窗(掌握) 2.8 其他参数建模 invfreqs inv...