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

Question about the code for the wave generation #1

Open
ahof1704 opened this issue Jul 23, 2020 · 0 comments
Open

Question about the code for the wave generation #1

ahof1704 opened this issue Jul 23, 2020 · 0 comments

Comments

@ahof1704
Copy link

ahof1704 commented Jul 23, 2020

Hi,

First of all, congratulations on your work. It is really cool stuff!
I would like to use your code to simulate the interaction of waves generated by two distinct sources (different frequency).

I believe this would be best function for such:

def broadcast_func_phased_antenna_focus2(t):
    broadcast_el = np.zeros((sz_x, sz_y), float)
    broadcast_el_mask = np.zeros((sz_x, sz_y), int)

    c_const = 6
    c = np.ones((sz_x, sz_y), float) * c_const

    my_lambda = c_const * (1 / 0.008) * 0.01 / 0.1

    broadcast_el[100:105, 0:1024] = 0
    broadcast_el_mask[100:105, 0:1024] = 1

    n = 2

    if (t<1000):
        for a in range(0, n):

            phase=-2 * m.pi * m.sqrt(m.pow(400,2)-m.pow(my_lambda/2*(a-n/2),2))/my_lambda

            broadcast_el_mask[105:115, int(1024/2-5+my_lambda/2*(a-n/2)):int(1024/2+5+my_lambda/2*(a-n/2))] = 1
            broadcast_el[105:115, int(1024/2-5+my_lambda/2*(a-n/2)):int(1024/2+5+my_lambda/2*(a-n/2))] = m.sin(2 * m.pi * (t) * 0.008 + phase)

    return broadcast_el, broadcast_el_mask, c

I would like to simulate two sources, wherein one source would have a frequency of 1Hz and the other 10Hz. How could I get this simulation to work? My interpretation is that the constant 0.008 in the code above corresponds to the frequency. What are the other terms in the 'my_lambda' equation?

Thank you in advance!

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

1 participant