USRP Software Radio

cancel
Showing results for 
Search instead for 
Did you mean: 

Bandwidth Occupier

I am looking to develop a project that can automatically determine the bandwidth occupied by the highest peak signal. I have attached the file I created, but it is not accurately calculating the bandwidth. Could someone please guide me on how to achieve this?

0 Kudos
Message 1 of 8
(309 Views)

 

Can you show some typical data?

(run the VI until the "baseband power spectrum" contains data, stop the VI, select that graph and do an edit..make selected values default)

 

Explain your definition  of "not accurately". In what way is the result not as expected?

There is a bit of code smell. Hammering the x-scale offset with every iteration is a bit much. Once is probably enough. Properties only should be written when they change. There is a +1 and -2 primitive, etc.

 

0 Kudos
Message 2 of 8
(302 Views)

I am attaching the VI file containing some saved data. The code calculates a bandwidth (BW) of 244 Hz; however, when measured on the spectrum, it shows 226 Hz—and sometimes even 200 Hz. This discrepancy is what I mean by "not accurately." The figure below also illustrates this when calculating the difference (upper limit - lower limit).

BW 226.PNG


I am currently using LabVIEW 2024. In LabVIEW 2017, I had access to the Spectral Measurements Toolkit, which included the SMT Occupied BW VI that automatically calculates the bandwidth of the highest peak signal. However, this toolkit does not work on LabVIEW 2024. Is there an alternative toolkit or VI available for LabVIEW 2024 that performs the same function? I have tried implementing a manual solution, but I am encountering the issues I mentioned earlier.

qureshi000_0-1741237071218.png

 

0 Kudos
Message 3 of 8
(271 Views)
0 Kudos
Message 4 of 8
(223 Views)

@qureshi000 wrote:

I am attaching the VI file containing some saved data. The code calculates a bandwidth (BW) of 244 Hz; however, when measured on the spectrum, it shows 226 Hz—and sometimes even 200 Hz. This discrepancy is what I mean by "not accurately." The figure below also illustrates this when calculating the difference (upper limit - lower limit).


Of course there is noise and you are overshooting because your results are quantized to integer data indices. With some simple changes, you can use threshold array, which will give you interpolated values where the connecting lines first cross the threshold. (read the help: the data needs to be non-descending, thus I flip and reverse as needed)

 

In your data, I get a value of 214, similar what you are expecting.

 

altenbach_0-1741679137072.png

 

 

A few quick comments on your code:

 

  • There is a "+1" primitive.
  • For pathological data, there is a nonzero chance that your VI will never complete and once you index outside the array, you get zero and will continue forever
  • Please do not maximize the diagram to the screen.
  • If you would place the -80 constant before the loops, you would only need one, making it easier to change if needed.
  • Personally, I would probably fit the data around the max to a suitable nonlinear model.
  • etc.
  •  

 

 

 

0 Kudos
Message 5 of 8
(196 Views)

What if I want to set threshold as 80% of total power of incoming signal then how can I do it?

0 Kudos
Message 6 of 8
(176 Views)

@qureshi000 wrote:

What if I want to set threshold as 80% of total power of incoming signal then how can I do it?


It with "total power", you mean the area under the peak, you would get sufficient data around the peak in power directly (instead of dB), determine the area under the curve, and find the points that enclose 80% of the area.

 

Again, if you have a mathematical model function that you can fit, you can get an analytic solution once you find the fitting parameters. Can you point to a website that describes the measurements?

0 Kudos
Message 7 of 8
(163 Views)

I want to set the threshold at 80% of the area under the peak. Since I am working with live data, there is no specific mathematical model or function that can accurately represent the shape of the peak. I need guidance on how to achieve this.

0 Kudos
Message 8 of 8
(148 Views)