berkiyo / spectrum

🔊 An easy to use frequency and amplitude spectrum analyser with room frequency response capabilities!
GNU General Public License v3.0
3 stars 1 forks source link

Hello, how to get the spectrum of the coordinate array, I am a novice, hope to get your help #1

Open zhubinsheng opened 3 years ago

berkiyo commented 3 years ago

Hi there,

Apologies for the late reply, while it has been a long time since I have updated Spectrum, I believe what you are after is how the graphview is used and what the coordinates are.

Most of the graphview plotting is done in the MainActivity and I am using the following libraries to achieve this:

import com.jjoe64.graphview.*;
import com.jjoe64.graphview.series.DataPoint;import com.jjoe64.graphview.series.LineGraphSeries;

Depending on what you are after, you may want to check out some of my graphview functions to get the graph coordinate system setup:

    public void initGraph(GraphView graph) {
        graph.getViewport().setXAxisBoundsManual(true);
        graph.getViewport().setMinX(0);
        graph.getViewport().setMaxX(10);

        graph.getGridLabelRenderer().setLabelVerticalWidth(100);

        // first mSeries is a line
        mSeries = new LineGraphSeries<>();
        mSeries.setDrawDataPoints(true);
        mSeries.setDrawBackground(true);
        graph.addSeries(mSeries);
    }

Hope this helps. :)