public static void Spectrum(byte[] audioBytes, AudioFormat format, Vector<Line2D.Double> SpectrumData) {
    	SpectrumData.removeAllElements();
    	int h=105, w=689;
        int[] audioData = null;
        int nlengthInSamples = audioBytes.length/2;
        audioData = new int[nlengthInSamples];

        for (int i = 0; i < nlengthInSamples; i++) {
        	int LSB = (int)audioBytes[2*i];
            int MSB = (int)audioBytes[2*i+1];
            audioData[i] = MSB << 8 | (255 & LSB);
        }

        int frames_per_pixel = audioBytes.length/format.getFrameSize()/w;
        byte my_byte = 0;
        double y_last = 0;
        int numChannels = format.getChannels();
        
        for (double x=0; x<w && audioData != null; x++) {
            int idx = (int) (frames_per_pixel * numChannels * x);
            my_byte = (byte) (128 * audioData[idx] / 32768 );        
            double y_new = (double) (h * (128 - my_byte) / 256);
            SpectrumData.add(new Line2D.Double(x+25.F, y_last+35.F, x+25.F, y_new+35.F));
            frame.repaint();
            y_last = y_new;
        }
    }