Why doesn’t ‘discrete delay bloc’ work with all discrete signals?

I try to make this equation in simulink: ARRIVba(Ka) =((Ca – toba(Ka)).* ENTERba(Ka)/ Ca)+ (toba(Ka -1).* ENTERba(Ka -1)/ Ca);

By using a Matlab function bolck. So I use a dicrete delay bloc to make toba(Ka -1) and ENTERba(Ka -1). But I don’t have the same signal delayed, just for toba(Ka -1), for ENTERba(Ka -1), I have the same signal. Can you help me please? All the best,

Computing Doppler delay on a meshgrid

Objective

Plot the contour of the iso-doppler and iso-delay lines for a transmitter-receiver reflection on a specular plane.

Implementation

This Doppler shift can be expressed as follows: $ $ f_{D,0}(\vec{r},t_0) = [\vec{V_t} \cdot \vec{m}(\vec{r},t_0) – \vec{V_r} \cdot \vec{n}(\vec{r},t_0)]/\lambda$ $

where for a given time $ t_0$ , $ \vec{m}$ is the reflected unit vector, $ \vec{n}$ is incident unit vector, $ \vec{V_t}$ is the velocity of the transmitter, $ \vec{V_r}$ is the velocity of the receiver, and $ \lambda$ is the wavelength of the transmitted electromagnetic wave.

The time delay of the electromagnetic wave is just the path it travels divided by the speed of light, assuming vacuum propagation.

#!/usr/bin/env python  import scipy.integrate as integrate import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as ticker  h_t = 20000e3 # meters h_r = 500e3 # meters elevation = 60*np.pi/180 # rad  # Coordinate Frame as defined in Figure 2 #      J. F. Marchan-Hernandez, A. Camps, N. Rodriguez-Alvarez, E. Valencia, X.  #      Bosch-Lluis, and I. Ramos-Perez, “An Efficient Algorithm to the Simulation of  #      Delay–Doppler Maps of Reflected Global Navigation Satellite System Signals,”  #      IEEE Transactions on Geoscience and Remote Sensing, vol. 47, no. 8, pp.  #      2733–2740, Aug. 2009.   r_t = np.array([0,h_t/np.tan(elevation),h_t]) r_r = np.array([0,-h_r/np.tan(elevation),h_r])  # Velocity v_t = np.array([2121, 2121, 5]) # m/s v_r = np.array([2210, 7299, 199]) # m/s  light_speed = 299792458 # m/s  # GPS L1 center frequency is defined in relation to a reference frequency  # f_0 = 10.23e6, so that f_carrier = 154*f_0 = 1575.42e6 # Hz  # Explained in section 'DESCRIPTION OF THE EMITTED GPS SIGNAL' in Zarotny  # and Voronovich 2000 f_0 = 10.23e6 # Hz f_carrier = 154*f_0;  def doppler_shift(r):     '''      Doppler shift as a contribution of the relative motion of transmitter and      receiver as well as the reflection point.       Implements Equation 14         V. U. Zavorotny and A. G. Voronovich, “Scattering of GPS signals from          the ocean with wind remote sensing application,” IEEE Transactions on          Geoscience and Remote Sensing, vol. 38, no. 2, pp. 951–964, Mar. 2000.       '''     wavelength = light_speed/f_carrier     f_D_0 = (1/wavelength)*(                 np.inner(v_t, incident_vector(r)) \                -np.inner(v_r, reflection_vector(r))             )     #f_surface = scattering_vector(r)*v_surface(r)/2*pi     f_surface = 0     return f_D_0 + f_surface  def doppler_increment(r):     return doppler_shift(r) - doppler_shift(np.array([0,0,0]))  def reflection_vector(r):     reflection_vector = (r_r - r)     reflection_vector_norm = np.linalg.norm(r_r - r)     reflection_vector[0] /= reflection_vector_norm     reflection_vector[1] /= reflection_vector_norm     reflection_vector[2] /= reflection_vector_norm     return reflection_vector  def incident_vector(r):     incident_vector = (r - r_t)     incident_vector_norm = np.linalg.norm(r - r_t)     incident_vector[0] /= incident_vector_norm     incident_vector[1] /= incident_vector_norm     incident_vector[2] /= incident_vector_norm     return  incident_vector  def time_delay(r):     path_r = np.linalg.norm(r-r_t) + np.linalg.norm(r_r-r)     path_specular = np.linalg.norm(r_t) + np.linalg.norm(r_r)     return (1/light_speed)*(path_r - path_specular)  # Plotting Area  x_0 =  -100e3 # meters x_1 =  100e3 # meters n_x = 500  y_0 =  -100e3 # meters y_1 =  100e3 # meters n_y = 500  x_grid, y_grid = np.meshgrid(    np.linspace(x_0, x_1, n_x),     np.linspace(y_0, y_1, n_y)    )  r = [x_grid, y_grid, 0] z_grid_delay = time_delay(r)/delay_chip z_grid_doppler = doppler_increment(r)  delay_start = 0 # C/A chips delay_increment = 0.5 # C/A chips delay_end = 15 # C/A chips iso_delay_values = list(np.arange(delay_start, delay_end, delay_increment))  doppler_start = -3000 # Hz doppler_increment = 500 # Hz doppler_end = 3000 # Hz iso_doppler_values = list(np.arange(doppler_start, doppler_end, doppler_increment))  fig_lines, ax_lines = plt.subplots(1,figsize=(10, 4)) contour_delay = ax_lines.contour(x_grid, y_grid, z_grid_delay, iso_delay_values, cmap='winter') fig_lines.colorbar(contour_delay, label='C/A chips', )  contour_doppler = ax_lines.contour(x_grid, y_grid, z_grid_doppler, iso_doppler_values, cmap='winter') fig_lines.colorbar(contour_doppler, label='Hz', )  ticks_y = ticker.FuncFormatter(lambda y, pos: '{0:g}'.format(y/1000)) ticks_x = ticker.FuncFormatter(lambda x, pos: '{0:g}'.format(x/1000)) ax_lines.xaxis.set_major_formatter(ticks_x) ax_lines.yaxis.set_major_formatter(ticks_y) plt.xlabel('[km]') plt.ylabel('[km]')  plt.show() 

Which produces this presumably right output:

enter image description here

Please feel free to provide recommendations about the implementation and style.

Questions

In order to compute the incident vector from a point $ r_t$ I’ve implemented the following code:

def incident_vector(r):     incident_vector = (r - r_t)     incident_vector_norm = np.linalg.norm(r - r_t)     incident_vector[0] /= incident_vector_norm     incident_vector[1] /= incident_vector_norm     incident_vector[2] /= incident_vector_norm     return  incident_vector 

This works perfectly fine, but I think there must be a cleaner way to write this. I would like to write something like this:

def incident_vector(r):     return (r - r_t)/np.linalg.norm(r - r_t) 

But unfortunately it doesn’t work with the meshgrid, as it doesn’t know how to multiply the scalar grid with the vector grid:

ValueError: operands could not be broadcast together with shapes (3,) (500,500) 

Branch Delay Slot – Como aplicar aqui?

Observar o seguinte exemplo:

Loop:        lw $  s2,100($  s3)        add $  s3,$  s3,4        beq $  s3,$  s4,Loop 

Para utilizar o branch delay slot neste exemplo posso resolver desta forma:

Loop:        addi $  s3,$  s3,4        beq $  s3,$  s4,Loop        lw $  s2,100($  s3) 

A minha dúvida é –> necessito de add $ s3,$ s3,4 antes de chegar ao beq $ s3,$ s4,Loop uma vez que o $ s3 é utilizado para a condição. Então pensei que a melhor opção seria passar lw $ s2,100($ s3) para depois, como se trata de Branch Delay Slot, a instrução após o salto é na mesma executada.

Por outro lado, a instrução lw $ s2,100($ s3) utiliza o valor de $ s3, para carregar em $ s2, portanto o valor que iria para $ s2 seria diferente de uma situação para a outra porque na situação do exemplo, $ s3 teria um valor que é desconhecido e que fica em $ s2. Caso adote esta solução

Loop:    addi $  s3,$  s3,4    beq $  s3,$  s4,Loop    lw $  s2,100($  s3) 

O valor de $ s2 já seria maior em 4 unidades. É possível resolver este exercício assim ou teria que colocar um nop (np-operation) por não conseguir executar corretamente com branch delay slot.

Com nop ficaria assim:

Loop:    lw $  s2,100($  s3)    add $  s3,$  s3,4    beq $  s3,$  s4,Loop    nop 

Notify Millions of subscribers at the same time(or with min. delay) in C++?

I’m working on a problem, in which i have some real time weather information of different cities through out the world. I’m exposing subscribe function to interested people/clients, with input:- location(this would be the name of the city) and time(HH::MM::SS).

Now, lets suppose, N number of people subscribe for Location=>(Paris) and time=>(20:10:17). Then, how can i publish/notify N of subscribers at exactly 20:10:17 for Paris location. I’ mean if iterate over the list of subscribers, then, this list processing itself would take delta time, some subscribers would receive information with delay.

What data structure should i use, e.g, list, map or vector etc, and how should i process it, i mean, threading model, so, that, i could be able to publish information to N number of subscribers at the same time with out any delay?

edit: Resolution is upto seconds, i mean, mili seconds delay is ok. And, server hardware capable of running Millions of threads.

Calculating the end-to-end delay of a message sent over a network

This is a problem from a MOOC on computer networking:

We wish to send a message of size $ 150,000$ bytes over the network. There are four hops, each of length $ 20$ km and running at $ 100$ Mb/s. However, before sending we split the message into $ 1500$ byte packets. What is the end-to-end delay of the message? Use speed of light in copper $ c = 2 * 10^8$ m/s, and round your answer to the nearest integer millisecond.

HINT: Break the problem into two parts: the end-to-end delay of one packet and the delay of the rest of the message across the slowest link.

After struggling for a bit, I obtained the answer by following the hint as follows:

$ $ 4\left(\frac{1500 \ B * 8 \ (b/B)}{100 \ Mb/s} + \frac{20 \ km}{2 * 10^8 \ m/s}\right) + \left(\frac{150000}{1500} – 1\right)\left(\frac{1500 \ B * 8 \ (b/B)}{100 \ Mb/s}\right) = 12.76 \ ms $ $ The answer is correct but I don’t understand why the packetization delay only was considered for the rest of the message. Why wasn’t the propagation delay also considered for the remaining packets?

How to prove a set of delay differential equations never converge (the delay is not constant)

Two functions $ x(t)$ and $ y(t)$ are coupled via: $ $ \dot X(t) = a Y(t)-b,Y(t+X(t))=X(t)$ $

where $ a<0, b$ is a constant.

I am mostly confused with the second equation. What is the mathematical term for this kind of delay differential equation? What kind of initial condition do I need to specify?

It is obvious that, if $ X(0)=Y(0)=b/a$ , then the system will stay stable for all $ t>0$ .

Through doing some simulation also back of envelope thinking, it seems that when $ X(0)=Y(0)=0$ , then the system may never converge to an equilibrium/stable solution. However, I have no idea what type of proof technique is required to show that.

Thanks!

Keyboard Shortcut For “Delay”

I’m currently building a web application which does task management.

A very common function is to “delay” the current task, which means it will be postponed until some point in the future. There’s already a link to click to delay it with the mouse, however I would like to make sure this can be done with the keyboard as well, for power users like me.

I do this extremely often, so I didn’t want to use a slower key combination like Ctrl + D (not to mention that’s already used for bookmarking). I really was hoping for a single key solution.

The function keys tend to have purposes already in the browser, and on laptops like mine and some others you have to enter a Fn+ combination to actually use them.

I didn’t want to use any of the letters because it’s quite common to have a text field selected, and you would end up typing in that field instead.

Temporarily I’m using the “delete” key, however even though that has the same first 3 letters, I think it’s a bad idea. I’ve already accidentally deleted emails a few times by having the wrong screen selected. (Thankfully there is a trash bin.) I’m sure that once the app becomes public this is bound to cause immense frustration.

So my question, is there any standard set currently for what key could be used to delay, postpone, snooze, etc…? Do any other programs that you know of have a similar function?

What key would you recommend as the most intuitive to be used for this function?

MQTT large delay between messages

I have a testing configuration which consists of a raspberry pi 3 b+ has a mqtt server, an esp32 with some led´s and a webpage to toogle them (webpage and esp32 are clients). For the esp32 i am using the PubSubClient has the library for the communication. Basically what it happens when i toogle a led, i publish “in1” topic which the esp32 is subscribed, reads its payload (“on” or “off”) and then it publishs a message to the broswer according the output state for confirmation. Keep in mind that this is all happening in a local network. After some tests, i saw that it takes max. 10 ms for the browser to publish a message. However, the complete cycle takes from 20 to 100 ms since the first publish message till the confirmation message (message esp32 sends reporting output state). Ive found out that it has nothing to do with the code since it takes 1ms from when the subscribed topic gets a new message, till the esp32 publishs the output state of the designed led.

The raspberry pi is running mosquitto v 1.5.5 with websockets enabled. Don´t think it has something to do with the configuration since the same happens when i test it with the mosquitto server i have in my laptop.

All the messages and subscriptions are 0 qos.

I just think it is a ridiculous amount of time for a communication in a local network, not to talk it´s very inconsistent (20 to 100 ms).

Very gratefull for all the help.

Customer Session Delay

I have a .phtml file that loops through dropdowns. There are 6 dropdowns belonging to two different groups (so 3 dropdowns per group).

I set a session on button click:

if ($  this->getRequest()->getParam(self::USERBIKE)) {     $  block = $  this->layoutFactory->create()->createBlock('Vendor\Module\Block\Garage');     if ($  block->getGarageCollection()->getFirstItem()->getCustomerId()) {         $  block->getCoreSession()->setUserBike(1);     } } 

Which I then use to check in the dropdown .phtml file:

if ($  session->getUserBike() == 1) {     $  useUserBike = true;     # etc. } 

However, nothing seems to happen.

I added some logging to check each dropdown to see what was going on:

$  writer = new \Zend\Log\Writer\Stream(BP. '/var/log/logfile.log'); $  logger = new \Zend\Log\Logger(); $  logger->addWriter($  writer);  # log each dropdown ID $  logger->info('OUTSIDE: '. $  block->getDropdown()->getDropdownId());  # log Session value per dropdown $  logger->info('OUTSIDE USER BIKE SESH: '. $  session->getUserBike());  if ($  session->getUserBike() == 1) {     $  useUserBike = true;     $  userBike = $  blockGarage->getGarageCollection()->getFirstItem();      # log cur dropdown ID     $  logger->info('CURDROPDOWNID: '. $  block->getDropdown()->getDropdownId());      # log cur dropdown group ID     $  logger->info('CURFINDERID: '. $  block->getDropdown()->getFinderId());      if ($  block->getDropdown()->getFinderId() == 1) {         switch($  block->getDropdown()->getDropdownId())         {             case 1: $  compareTo = $  userBike->getMakeId(); break;             case 2: $  compareTo = $  userBike->getModelId(); break;             case 3: $  compareTo = $  userBike->getYearId(); break;             default: $  compareTo = 0; break;         }     }      # log compareTo value     $  logger->info(isset($  compareTo) ? $  compareTo : 'empty str');     $  logger->info('======================================'); # visibility break } 

The output of my logfile:

2019-01-09T16:33:47+00:00 INFO (6): OUTSIDE: 1
2019-01-09T16:33:47+00:00 INFO (6): OUTSIDE USER BIKE SESH:
2019-01-09T16:33:47+00:00 INFO (6): OUTSIDE: 2
2019-01-09T16:33:47+00:00 INFO (6): OUTSIDE USER BIKE SESH:
2019-01-09T16:33:47+00:00 INFO (6): OUTSIDE: 3
2019-01-09T16:33:47+00:00 INFO (6): OUTSIDE USER BIKE SESH:
2019-01-09T16:33:47+00:00 INFO (6): OUTSIDE: 4
2019-01-09T16:33:47+00:00 INFO (6): OUTSIDE USER BIKE SESH: 1
2019-01-09T16:33:47+00:00 INFO (6): CURDROPDOWNID: 4
2019-01-09T16:33:47+00:00 INFO (6): CURFINDERID: 2
2019-01-09T16:33:47+00:00 INFO (6): empty str
2019-01-09T16:33:47+00:00 INFO (6): ======================================
2019-01-09T16:33:47+00:00 INFO (6): OUTSIDE: 5
2019-01-09T16:33:47+00:00 INFO (6): OUTSIDE USER BIKE SESH: 1
2019-01-09T16:33:47+00:00 INFO (6): CURDROPDOWNID: 5
2019-01-09T16:33:47+00:00 INFO (6): CURFINDERID: 2
2019-01-09T16:33:47+00:00 INFO (6): empty str
2019-01-09T16:33:47+00:00 INFO (6): ======================================
2019-01-09T16:33:47+00:00 INFO (6): OUTSIDE: 6
2019-01-09T16:33:47+00:00 INFO (6): OUTSIDE USER BIKE SESH: 1
2019-01-09T16:33:47+00:00 INFO (6): CURDROPDOWNID: 6
2019-01-09T16:33:47+00:00 INFO (6): CURFINDERID: 2
2019-01-09T16:33:47+00:00 INFO (6): empty str
2019-01-09T16:33:47+00:00 INFO (6): ======================================

As you can see, The session doesn’t have a value ’til the 4th dropdown. Why is this happening? What am I doing wrong?