Finally figured out the bug, traced it to fftw (was doing row x col instead of col x row). Everything works (whitening spectrum, zero-padding trn samples, etc) for 1D and 2D datasamples of different numeric types. Need to get 2D working for more than 4 training samples.