This paper presents a method to discover the discriminative patterns or features in hyperspectral data for classification. The proposed method searches the data space along both spectral and spatial frequency axis and combines the adjacent spectral and spatial frequency bands so that a simpler but more effective feature set is achieved. The algorithm is tested on hyperspectral images of hazelnut kernels. The detected features were evaluated for classifying contaminated and uncontaminated hazelnut kernels. The developed algorithm is adaptive, robust and can be applicable to other type of hyperspectral data.