# How to architect a “for loop” (frequency hopping) in gnuradio (companion)?

I have the setup where I send data via USRP Sink over an SDR and receive the response. However, this needs to be performed at different carrier frequencies, sequentially in time but continuously (the switching should be performed as fast as the SDR can settle reasonably well). The aggregated received data for all frequencies should be combined and used for further processing and eventually update a graph.

In a procedual language:

f = [ 300e6 400e6 500e6 800e6 ];
while(1)
aggregate_data = [];
for k=1:length(f)
txdata = get_tx_datastream();
send_via_usrp(f(k), txdata);