I`m doing some simulations using this toolbox and i must say i love it.
Also i have a question. I`m generating some signals in simulink (Amplitude=1). Have 2 sources and 1 sensor. Currently only 'p' is recorded. The resulting value at the sensor_data.p is from -0.2 to 0.2 . How do i convert those into dB ? I need to get simulation results, and then compare it with microphone recordings, to see if they "match" .
k-Wave
A MATLAB toolbox for the time-domain 
 simulation of acoustic wave fields
	Data unit conversion from sensor
(4 posts) (2 voices)- 
		Posted 12 years ago #
- 
		Hi toxie87, Assuming you are doing linear simulations, the magnitude of your output scales linearly with the magnitude of your input (so in your case, if your input amplitude was 2 instead of 1, your output values would range from -0.4 to 0.4). If you know the actual pressure of your source in Pascals, you can use this to calculate the magnitude of your output in Pascals. You can then convert Pascals to a sound pressure level in dB using the formula 20*log10(p_output/p_ref), wherep_ref = 20e-6;If you want a relative drop in dB, you can calculate this directly using by setting p_ref equal to your input magnitude (the scaling of the input and output doesn't matter, as long as they are the same). Hope that helps! Brad. Posted 12 years ago #
- 
		Thanks for the reply Brad. I`m already using the formula u gave me, but due to the negative values, as a result i have complex numbers. Also the readings are pretty strange to me. 0.2246 is the maximum at the sensor and after the formula, the max is -Inf, the second largest is 186.72dB ?!?? It should be 81dB by my calculations. Am i wrong ? Posted 12 years ago #
- 
		Hi toxie87, Sorry, I should have mentioned, the value for p_outputshould be the RMS (root mean squared) value of your output signal (in steady state if you are using a continuous wave input). This will be a single positive number.Brad. Posted 12 years ago #
Reply
You must log in to post.