dB

Consider a 1V Vpk signal
i.e. its 0dB at 1V.

			
				clear; clc;

				% header
				fprintf('volts \t dB\n');

				% in volts
				V = [1e-6 1e-5 1e-4 1e-3 1e-2 1e-1 1];

				% in decibels
				VdB = 20*log10(V);

				% use transpose to print side-by-side
				fprintf('%1.0e \t %3.0f\n', [V',VdB']'); 
			
		
			
				>>
				volts 	 dB
				1e-06 	 -120
				1e-05 	 -100
				1e-04 	 -80
				1e-03 	 -60
				1e-02 	 -40
				1e-01 	 -20
				1e+00 	   0
			
		
© 2018 Copyright. For individual use only. No liability is accepted for any consequences of using information on Testips.com.