blob: bf81cb905bdb41e744641eeda07952461b1bf27f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
//Chapter 21, Example 21.1
clc
//Initialisation
vo=2.5 //Output Voltage
vi=0.01 //input voltage
//Calculation
sn=20*log10(vo/vi) //signal to noise ratio
//Results
printf("S/N Ratio = %d dB",round(sn))
|