Hi Sangwoo,
I understand you want to plot the SPL Graph in frequency domain and want to know the value of “P_ref”.
In the formula for Sound Pressure Level (SPL), “P_ref” is the reference pressure level. It is a fixed reference value used to calculate the SPL in decibels (dB). The commonly used reference pressure level in acoustics is 20 micropascals (uPa), which corresponds to the threshold of hearing for the average human ear at a frequency of 1 kHz.
So, when you have FFT data for P1 and want to calculate SPL in the frequency domain, you should use “P_ref” as 20 uPa for all frequency components. This is because the reference level for SPL remains constant across different frequencies.
Here's how you can calculate SPL in the frequency domain using FFT data:
1. Compute the FFT of the sound signal to obtain the frequency domain representation of P1.
2. For each frequency component in the FFT data, calculate the magnitude (absolute value) of P1 at that frequency.
3. Use the formula for SPL:
SPL(f) = 20 * log10(|P1(f)| / P_ref)
Where:
- “SPL(f)” is the SPL at frequency “f”.
- “|P1(f)|” is the magnitude of P1 at frequency “f”.
- “P_ref” is the reference pressure level (20 uPa).
4. Plot the calculated SPL values against the corresponding frequency components.
You can try writing the code using the above steps. Hope this solves your query.