I am new to AndroidPlot. I am trying to plot a graph as described below using AndroidPlot.
Data to my graph: (This operation is done on background thread)
Continuously getting data from microphone with sampling freq =22050 No of Samples = 1024
Applying FFT to data obtained, thus i have multiple sets of 1024 points
The above data is sent to main thread (UI thread) every time i read the data from microphone
Plot of my graph: (This plotting of graph is done on main thread)
every time the data is read in background thread, it (FFT data) is updated to UI thread and should be plotted (1024 points in each update)
thus as time proceeds, there should be a moving plot which shows 1024 points of FFT data at each point
(i.e X Axis being each update of FFT data to UI thread, Y Axis being 1024 points of FFT data)
Current approach tried for plotting graph:
Creating new instance of SimpleXYSeries for storing each update of 1024 points and then plotting the graph.
Eventually i need to show approximately some 100 updates i.e. 100 * 1024 points on the graph. After 100th update i want the graph to move from left to right showing 100 updates at any point of time.
The problem is very obvious, as there is large set of points to be drawn on the graph, it leads to OutofMemoryException. I have seen some answers to previous similar problem questions (in this link https://groups.google.com/forum/#!msg/androidplot/6Vte1F6Sid4/50NPQ1yFRFMJ) where Nick has suggested not to use SimpleXYSeries, and to implement XYSeries as per our needs. So my question goes as follows:
Is it possible to implement the above described graph (100 * 1024 points) by implementing XYSeries?
Could anyone please suggest me a better way to implement this graph with good speed and performance? Also an example for implementing our own XYSeries
I am very much stuck at this point. Your help would be appreciated.