Programming Problems 4

1. Wavelets. Applications to computer vision, human vision, speech processing, compressing the FBI fingerprint database, filtering noisy data, detecting self-similarity in time series, sound synthesis, computer graphics, medical imaging, analyzing the clumping of galaxies, and analyzing turbulence. The Haar function is definite by Φ(x) = 1 if 0 ≤ x < 1/2, Φ(x) = -1 if 1/2 ≤ x < 1, and Φ(x) = 0 otherwise. For integer m and n, the Haar basis function Φ m,n(x) = 2 -m/2 Φ(2 -mx - n). Write a program Haar.java that takes two integer input M and N, and one real input x and prints Φ m,n(x). Or maybe plot it?

2. US postal barcodes. The POSTNET barcode is used by the US Postal System to route mail to the individual delivery carrier. Each decimal digit in the zip code is encoded using a sequence of 3 half-height and 2 full-height bars for use by scanners as follows:
Value 0 1 2 3 4 5 6 7 8 9
Encoding ||╷╷╷ ╷╷╷|| ╷╷|╷| ╷╷||╷ ╷|╷╷| ╷|╷|╷ ╷||╷╷ |╷╷╷| |╷╷|╷ |╷|╷╷

The barcode starts and ends with a full-height bar (the guard rail). A checksum digit is appended (after the 5 digit zip code or ZIP+4): it is computed by summing up the original digits mod 10. Write a program that reads in a five (or nine) digit zip code as the command line parameter and prints out the corresponding postal bar code.

  • Function to plot a half-height and full-height bar.
  • Function to plot the sequence of bars for a given digit.
  • Function to compute the check digit.
  • Function to pad a number with leadings zeros (if necessary).
  • Function to parse the input string "08544-1234" into digits (or command line should be ZIP then +4 or just ZIP).
  • Function to check whether a given zip code + check digit is valid.  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值