Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amplitude in received signals in forward modeling with ultrasound signal (1MHz) #82

Open
shoaibanwar66 opened this issue Oct 30, 2024 · 2 comments

Comments

@shoaibanwar66
Copy link

Hi,

I am trying to compare SEM and FDM in USCT applications. I have been working with SPECFEM (a spectral element solver) for acoustic USCT applications and recently started working with deepwave. However, I noticed that the amplitude of the received signal in deepwave is way too low (in e-10). I am wondering if I am making any mistake. Would you please let know if there is any way to increase the signal amplitude in receiver end.

Here is the example code.

`import torch
import deepwave
import matplotlib.pyplot as plt
import numpy as np
import torchvision

plotting = True
v = 1500 * torch.ones(50, 50)

freq = 1e6
NT = 4500
DT = 2.5e-9

grid_spacing_orig = 2.5e-4
grid_spacing = grid_spacing_orig #4.1441559515042545E-005
dx = grid_spacing

cell_number = 50 / grid_spacing

#print (cell_number)

Src = [0.006, 0.010]
Rcv = [0.006, 0.001]

peak_time = 1/freq
source_amplitudes = deepwave.wavelets.ricker(freq, NT, DT, peak_time).reshape(1, 1, -1)
#print (source_amplitudes.squeeze().detach().numpy().shape)

source_locations=torch.tensor([[[Src[0]/grid_spacing_orig, Src[1]/grid_spacing_orig]]])
receiver_locations=torch.tensor([[[Rcv[0]/grid_spacing_orig, Rcv[1]/grid_spacing_orig]]])

print (Rcv[0]/grid_spacing_orig, Rcv[1]/grid_spacing_orig)

out = deepwave.scalar(
v, grid_spacing=grid_spacing, dt=DT,
source_amplitudes= source_amplitudes,
source_locations=torch.tensor([[[Src[0]/grid_spacing_orig, Src[1]/grid_spacing_orig]]]),
receiver_locations=torch.tensor([[[Rcv[0]/grid_spacing_orig, Rcv[1]/grid_spacing_orig]]]),
accuracy=8, pml_width=[2, 2, 2, 2], pml_freq=1
)

pred_signals_swap = out[-1]

if plotting == True:
y = pred_signals_swap.squeeze()
#print(y.shape)
freq = 1e6
nt=NT
dt=DT
plt.figure()
plt.plot(np.arange(0, dtnt, dt)-1.21e-6, source_amplitudes.squeeze().detach().numpy())
plt.savefig("STF_deepwave.png")
plt.figure()
plt.plot(y.detach().numpy())
plt.savefig("sig_pre_0_2")`

I have attached the STF and received signal images bellow.
sig_pre_0_2
STF_deepwave

@ar4
Copy link
Owner

ar4 commented Oct 31, 2024 via email

@shoaibanwar66
Copy link
Author

Thanks. Dividing by dx**2 actually helped.
I need to go through the documentation about PML frequency again. No worries. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants