How would you draw this in MATLAB?
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I have an equation for the absorption coefficient in underwater acoustic communication channel (UWA) as:
alpha=0.11.*(f.^2./(1+f.^2))+44.*(f.^2./(4100+f))+2.75*10^-4.*f.^2+0.003;
where f is the frequency in kHz, and the absorption coefficient is given by dB/Km. I have a paper that plots this relation versus the frequency. It is straightforward as it appears at first, but when I tried to do it myself I have not gotten the same curve, even though the vertical axis in the paper is in dB/Km, which means it is just a direct substitution in the above equation. The question is why?
Thanks in advance
3 个评论
Jan
2012-3-4
All we know is the formula and that you do not get the "same curve". It might be a typo in the formula, another scaling of log-scaling, different colors or line styles, a post-script problem in the paper, etc. I do not see a chance to guess the source of the differences yet. Please post the necessary details.
回答(4 个)
Jan
2012-3-5
Unfortunately you still did not describe, which difference you mean. I guess it is the small wobble near to 60Hz.
When I read the explanation about the Figure 1 in this paper, I find at first the above formula and then:
This formula is generally valid for frequencies above a
few hundred Hz. For lower frequencies, the following
formula may be used:
10 log a(f) = 0.002+ 0.11*(f.^2 ./ (1 + f.^2)) + 0.011 * f.^2
I guess, that the author used this formula for the low frequency part.
[EDITED] Check your formula again. It is "4100+f.^2" instead of "4100+f".
4 个评论
Jan
2012-3-5
Ok, not much, but at least enough?
I suggest the standard notation of numbers mainly, because this is faster to write and to read. This is more important than the runtime.
G A
2012-3-5
This gives the same picture as in the paper:
clear;
f=0:1000;%kHz
alpha=0.11.*f.^2./(1+f.^2)+44.*f.^2./(4100+f.^2)+2.75e-4.*f.^2+0.003;%dB/km
figure(1)
clf
plot(f,alpha,'-b')
3 个评论
Honglei Chen
2012-3-5
In your original question, it says f is in kHz so that's why you don't need to multiply 1e3.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Marine and Underwater Vehicles 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!