Providing Signal Data Question #50
Replies: 14 comments
-
Are you referring to a 2D signal here? Like an image? There are different kinds of signals with multiple channels - for example, accelerometers have x, y and z axes but all of those are captured independently with respect to time. Grayscale images have x and y data but they are interdependent and does not have a temporal information within. |
Beta Was this translation helpful? Give feedback.
-
The data input I'm working with is in the form of collected x,y and z position data points as a function of time. I have a text file that lists each trio of x,y,z coordinates on its own line down the file without the time (though I can add the time manually to each line if it's necessary to have the time as part of the data for JDSP to process it). Can this type of data be processed for filtering? |
Beta Was this translation helpful? Give feedback.
-
Time is not an essential parameter. You will need each axis to be in a separate array however. |
Beta Was this translation helpful? Give feedback.
-
Wonderful. So then how would this look incorporated into the sample code below? How exactly do I put my 3 arrays in the filter object once I have them? // My arrays: // Sample code for Butterworth filter: |
Beta Was this translation helpful? Give feedback.
-
Simply replace Currently your implementation will look like this:
|
Beta Was this translation helpful? Give feedback.
-
Sounds good. So at that point with the resultX, resultY and resultZ arrays, I must plot/graph each array separately? My understanding then is that each array's contents is basically it's own dependent variable, so if I want to plot them, what should I provide to my plotting program for each array's independent variable? Should I provide the original data's time collection values for plotting those three arrays individually (my apologies if my question is a bit elementary, but I am new to signal processing)? Thanks. |
Beta Was this translation helpful? Give feedback.
-
Depends on what you are using to plot. The following example will plot all your outputs in a single figure.
If you don't have a time array, you can also ignore it.
|
Beta Was this translation helpful? Give feedback.
-
I'll give this a try. Thanks again. |
Beta Was this translation helpful? Give feedback.
-
I just wanted to say thanks for all your help with using JDSP. This is an amazing piece of software. My follow up question is the following: given that I now have individual plots for x vs time, y vs time and z vs time, which all look like signals (they each kind of resemble stock market price plots), what kind of signal processing exercise do you recommend for this kind of data and are there any physical interpretations of such a signal processing exercise from this "position vs time" data? If it means anything, I also observed bell curve-shaped distributions of the various x, y and z values (don't know if they're specifically normal distributions though). Thanks again. |
Beta Was this translation helpful? Give feedback.
-
The kind of signal processing technique you use on this data is entirely dependent on what you're trying to achieve from this. You need to go through your problem statement and understand what the best course of action would be to solve the problem. |
Beta Was this translation helpful? Give feedback.
-
That sounds good and it does make sense. I'll start with analyzing frequency to begin with. Looking at the Fourier transforms on the JDSP website, I noticed that the sample code,
declares a _Fourier object called "ft" but the output method of getMagnitude is applied to "fft." Was that supposed to be "ft" instead of "fft" or did something else need to be declared/defined earlier? Also, I noticed that there is a PCA class to do PCA analysis. In the PCA section of the JDSP webpage, the example is for a tri-component data set composed of X, Y and Z much like my own data. However, I see that there is input for only one signal variable named "signal." Would you please tell me, how should the "signal" variable (I assume a 1-D array of type double) be structured to accomodate X, Y and Z? Similarly, the output signal (called "newSignal") is shown to be a 2-D array, but the provided plot of the PCA output signal appears to be for one dimensional data (a standard Y vs X plot). Below is the PCA code I refer to:
Thank you again for helping me with using JDSP and understanding signal processing concepts (I am reading on my own to try to catch up to speed). |
Beta Was this translation helpful? Give feedback.
-
Thanks for pointing that out - it should be For PCA, it is a 2D signal where Dimension 1 holds the samples and Dimension 2 holds the channels.
which implies the signal has 2 channels and 5 samples. For the output, since PCA does not always imply the output to have only one dimension (you can use PCA to reduce from 3 to 2 dimensions as well), the output is in 2D. In this example, it is just that we are choosing to reduce to 1 dimension. For plotting, the 2D output array has been flattened. |
Beta Was this translation helpful? Give feedback.
-
Closing the issue since the queries seem to have been addressed, |
Beta Was this translation helpful? Give feedback.
-
Awesome. Thanks again for all your help and again, I just want to say that this is a wonderful library you've made here. |
Beta Was this translation helpful? Give feedback.
-
If I have data in the form of x,y coordinates, how do I get this data into JDSP? I noticed that data input into, say, a low pass filter is in the form of a 1-D array of type double which is essentially a list of one set of numbers not two. Should the numbers in the 1-D array be in pairs as in [x1, y1, x2, y2, x3, y3, etc...]?
Beta Was this translation helpful? Give feedback.
All reactions