Routine mampres: To obtain amplitude response from h(exp(jw)).
input parameters:
h :n dimensioned complex array. the frequency response is stored
in h(0) to h(n-1).
n :the dimension of h and amp.
fs :sampling frequency (Hz).
iamp:If iamp=0: The Amplitude Res. amp(k)=abs(h(k))
If iamp=1: The Amplitude Res. amp(k)=20.*alog10(abs(h(k))).
output parameters:
amp :n dimensioned real array. the amplitude-frequency response is
stored in amp(0) to amp(n-1).
Note:
this program will generate a data file "filename.dat" .
in chapter 2
對于n后問題,用n元組工[1:n]表示n后問題的解。其中x[i],表示皇后i放在棋盤的第i行的第i列。由于不允許將2個皇后放在同一列,所以解向量中的x[i]互不相同。2個皇后不能放在同一斜線上是問題的隱約束。對于一般的n后問題,這一隱約束條件可以化成顯約束的形式。將n x n格棋盤看作二維方陣,其行號從上到下,列號從左到右依次編號為1,2,…,n。從棋盤左上角到右下角的主對角線及其平行線(即斜率為一1的各斜線)上,2個下標值的差(行號一列號)值相等。同理,斜率為+1的每一條斜線上,2個下標值的和(行號+列號)值相等。