function [M,w] = h2mag(h)
% [M,w] = h2mag(h)

L = 2^9;
M = abs(fft(h,2*L));
M = M(1:L+1);
w = [0:L]'*pi/L;

