I am a new learner about sensors. I have no knowledge about this sensors. However I have done some sensor module which contains with accelerometer,gyroscope and magnetometer. All of them have 3 axis data (X,Y,Z).Now i have data as a TXT file format but I couldn't find any solution for extraction this data features. I am going to use this data with NNet. Could anyone help me with making program in Matlab,please? Any suggestion and opinion will be useful for me.
Thanks in advance!
As zellus suggested, the reading from textfile is well documented in MATLAB. Look for functions textread or csvread.
As I understand it, you are looking for help understanding the data that you have collected. You may get some answers here, but you are most likely better off asking what you should be looking for in a physics/engineering related forum, then coming back here for help implementing your code if need be.
As a starting point, you could try:
Plotting the change in the data over time, for each direction.
Looking at the magnitude of each of accelerometer, gyroscope and magnetometer data (using norm), and plotting these over time
Making a scatter plot of the norms of, for example, acceleration vs magnetometer - is there any correlation?
Likewise a scatter plot of X acceleration vs Y acceleration, or X vs Z etc.
Remember, in MATLAB, the plotting tools are your friend.
Related
G'day,
Have been provided a p-code MATLAB program to find data tips from a graph. Attached is an image of a step response of unknown magnitude of a water tank system.
For better accuracy, I would like to extract data at discrete intervals instead of zooming in and attempting to click on a whole number. Is there a way of doing this through the graph/data tips, without writing code.
Is this even possible with a graph received from a P-code? or will I have to just average out multiple attempts.
Cheers
I am a developer and not very familiar with MATLAB unless its about basics. Lately, I read some articles about Kemar HRTF database and i would like to test it under MATLAB to get a clear idea what it does, then try to implement an android audio 3D application using hrtf.
I looked everywhere for a good documentation but i couldnt find any (example)..
I know i should convolve my input stereo signal with the hrtf, but can anyone explain to me what is the meaning of all the files in the database, and which one to use? I ll be grateful.
HRTFs are direction dependant. The database is in polar coordinates, the folders are elevation angle and the files contain the impulse response for a respective azimuth under that elevation angle (for left and right channels respectively).
You need to use the impulse responses that correspond to the direction that the audio is supposed to come from and fold your audio data with that (or use the FFT on both, multiplicate them, then use the IFFT).
Note that that database is very old. It shouldn't be too hard to get data with better angular resolution (10° resolution in elevation is quite bad).
See http://sofacoustics.org/
http://sofacoustics.org/data/database/ari%20%28artificial%29/ in particular. The data from ARI usually has a resolution of 2.5°.
I have a 2D graph that I have created of frequency vs. amplitude as a way to characterize a signal. I am trying to figure out how to write script that takes the WAV I have already imported into MATLAB, and figure out the peaks, the troughs, and the distance between each one. Can someone please help me with some general guidelines, not a complete code, for a script that will help me do this?
There are several submissions on the file exchange for this. For instance this one, seems applicable (I haven't tested it myself, but it looks good).
Try to search a bit on the file exchange and you will likely find something you can use.
You can also have a look at this question, and this one.
I have a set of 3D points which numbers up around 1 million points. I am looking to visualise these with matlab.
I have tried the following functions:
plot3
scatter3
But they are both very sluggish. Is there a more efficient way to visualise this level of points in matlab? Maybe a way to mesh the points?
If not can anyone suggest a plug-in or even a different program for visualising 3D points?
You're going to run into efficiency issues no matter what plugin/program you use if you want all million+ points to show up in a plot. My suggestion would be to downsample. Use the plot3 or scatter3 function on every other point, or every nth point, until you get a figure that is not sluggish. As long as the variance in your data isn't astronomical, downsampling a little bit shouldn't affect the overall distribution of points (given that you have a million+ points). And any software that is able to display that much data without being sluggish is most likely downsampling/binning or using some interpolation technique to do so (so you might as well have control over it).
fscatter3 from the file exchange, does what you like.
Is there a specific reason to actually have it display that many points?
I Googled around a bit and found some people who have had similar issues (someone suggested Avizo as an alternate program but I've never used it):
http://www.mathworks.com/matlabcentral/newsreader/view_thread/308948
mathworks.com/matlabcentral/newsreader/view_thread/134022 (not clickable because I don't have enough rep to post more than two links)
An alternate solution would be to generate a histogram if you're more interested in the density of the data:
http://blogs.mathworks.com/videos/2010/01/22/advanced-making-a-2d-or-3d-histogram-to-visualize-data-density/
I you know beforehand roughly the coordinates of the feature you are looking for, try passing the cloud through a simple pass-through-filter, which essentially crops your point cloud. I.e. if you know that the feature is at a x-coordinate > 5, remove all points with x-coordinate < 5.
This filter could for the first coordinated be realized as
data = data(data(1,:) > 5,:);
Provided that your 3d data is stored in an n by 3 matrix.
This, together with downsampling, could help you out. If you still find the performance lagging, consider using something like the PCD viewer in PointCloudLibrary, check half way down the page at
http://pointclouds.org/documentation/overview/visualization.php
It is a stand alone app you could launch from matlab. I find it's performance far better than the sluggish matlab plotting tools.
For anyone who is interested I ended up finding a Point cloud visualiser called Cloud Compare. It is extremely fast and allows selection and segmentation as well as filtering on point clouds.
I'm looking for some functions in MATLAB in order to find out some parameters of sound,such az intensity,density,frequency,time and spectral identity.
i know how to use 'audiorecorder' as a function to record the sampled voice,and also 'getaudio', in order to plot it.But i need to realize the parametres of a sampled recorded voice,that i mentioned above.i'd be so thankful if anyone could help me.
This is a very vague question, you may want to narrow it down (at first) and to add as much contextual details as you can, it will certainly attract a lot more answers (also as mentionned by Ion, you could post it at http://dsp.stackexchange.com).
Sound intensity: microphones usually measures pressure, but you can get the intensity from that quite easily (see this question). Your main problem is that microphones are not usually calibrated, this means that you cannot associate an amplitude with a pressure. You can get sound density from sound intensity.
Frequency: you can get the spectrum of your sound by using the Fast Fourier Transform (see the Matlab function fft).
As for spectral or time identity, I believe these are psychoacoustics notions, which is not really my area of expertise.
I'm no expert but I have played with Matlab a little in the past.
One function I remember was wavread() to input a sound signal into Matlab, which if executed in this form [Y, FS, NBITS]=WAVREAD("AUDIO.WAV") would return something like:
AUDIO.WAV:
Fs = 100 kHz
Bits per sample = 10
Size = 100000
(numbers from the top of my head)
Now about the other things you ask, I'm not really sure. You can expect a better answer from somebody else. I think this question should be moved to Signal Processing SE btw.