• Content Count

  • Joined

  • Last visited

About Phil_D

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks @attila! If I'm using the API functions (from Waveforms SDK reference manual) to configure and acquire data from the ADCs, can I set the high/low gain or the high/low attenuation? Are there specific functions to do this, or do these things happen automatically based on input signal level, even when using the API?
  2. Just to be clear on the setup in case I did post this in the wrong place, I'm using: -Analog Discovery 2 -Waveforms Beta Version 3.11.2 64-bit Qt5.9.7 Windows 7 SP 1 -I'm using the Waveforms Spectrum Analyzer tool a lot, along with the API calls for the ADC. I do also look at the Waveforms scope for troubleshooting.
  3. Thanks for the response @Fa-b! I see the reference to ADG612 in the Analog Discovery 2 Reference Manual: And it's this section that also mentions just the two gain settings, low gain at 0.019 and high gain at 0.212, basically a factor of 10 apart.
  4. I see in the documentation that the ADG612 gain switch between high gain and low gain to the ADC. I see in Waveforms Spectrum analyzer that there are many gain options: 0.01x, 0.1x, 1x, 10x, 100x. Which hardware gain setting is used in Waveforms for those gain settings? Thanks!
  5. One more hopefully quick question here: I would like to export the data after all of the windowing/padding/averaging is complete. I'm using: Spectrum1.Export("C:/Users/User/pjm_2019/data.txt") ...but this gives me the results for Trace1, Trace5, and Trace 6. Is there a way to export only Trace 6? I tried: Spectrum1.Trace6.Export("C:/Users/User/pjm_2019/data.txt") but that gave me an error. Thanks!
  6. Thank you @attila! The windowing before the padding seems to have worked. We'll have to experiment with the CZT to see if it will meet our needs and perhaps be easier than an FFT with the padding script.
  7. Thank you for the continued support on this, @attila! However, I think that the FFT window function is not working right when we pad before doing the windowing function. I'll explain: I'm using another signal processing program called Sigview, and I can add zero padding there as well. I did a bunch of exporting and graphing in Excel to compare padding between Sigview and Waveforms: These are the two FFTs I'm getting in Waveforms, no padding in red and 2x padding in green. You can see that the 2x padding trace in green does not look at all like the red trace without padding. This graph below is comparing Waveforms and Sigview, both Hann windows, both using no padding. They are basically identical, except for a 3dB offset. I used magnitude in Sigview and RMS (dB) in Waveforms, which I think accounts for that 3dB. But the important thing is that the shape of the FFTs is identical. Same data in both cases, same window (Hann), both programs produce the same FFT. Now, I add padding in Sigview. Blue is 2x padding, magenta is no padding. The traces are nearly identical, except the padding in the blue trace helps smooth out the peaks. I think this is how the padding should work. We were wondering if it would be possible to do the math to apply the Hann window on the data array in the script *before* adding the padding? So the order of operations would be: 1. Apply the Hann window to the data 2. Add zero padding 3. Take the FFT It looks like you added the padding, then did the window, then did the FFT. As you mentioned, applying the window after the padding really attenuates the actual data and adds more emphasis to the 0's. I would like to add the padding in Waveforms so we can take advantage of the averaging. With Sigview, I'd have to import many static datasets, process each one separately, and then average in C++, which would be much more laborious and time consuming. We found a couple of links that talk about this padding and windowing: Thanks!
  8. This is great! Thanks @attila! Does this script end up with a rectangular window? The padded, averaged result from the script looks very different from our previous unpadded result. Is there a way to set the type of windowing function that is used in your script? We'd like to use a Hann window. I tried to look through other objects/functions with cntrl+space, but didn't see any way to set the window type. Also, if I wanted more than 2x padding, would I do something like for(var i = 0; i < 2*c; i++) rg.push(t) //4x padding??? Thanks!
  9. Thanks @attila! It only occurred to do this after I saw the loop in your zero padding example.
  10. Is there a way for a script function to have a delay that will wait for a certain number of averages to take place before stopping the trace? Right now, I'm doing this: wait(1.1) Spectrum1.stop() Spectrum1.Export("C:/Users/User/pjm_2019/acquisition410.doc") For the few times I tried this by hand, 1.1 seconds was enough time to get at least 50 averages in my trace. I'm just wondering if there isn't something a little more precise than this, that would maybe get feedback from the Spectrum display and know exactly when 50 averages was achieved. Thanks!
  11. Thanks @attila! Is there a way to have the zero padded trace continue to run and be averaged?
  12. Thank you @attila! This update seems to be working for me! Also, thank you for the suggestion @bvleo! For anyone reading this thread and trying to do something similar, I created a python script with these commands: import subprocess subprocess.Popen(['C:/Program Files (x86)/Digilent/WaveForms3/WaveForms.exe','C:/Users/User/pxm_2019/pn_410.dwf3work']) subprocess.Popen(['C:/Program Files (x86)/Digilent/WaveForms3/WaveForms.exe','C:/Users/User/pxm_2019/pn_410.dwf3work','-runscript']) This opens Waveforms, opens my workspace with the saved script (that is open within the saved workspace), and then runs the script. If Waveforms is already open, then I can just create a second python script with the second line deleted. ps: If you try to copy and paste code out of here into notepad, you'll probably get some extra characters and python will give errors, so watch out for that.
  13. Thanks @attila. Now, I'm using this: import subprocess subprocess.Popen(['C:/Program Files/Digilent/WaveForms3/WaveForms.exe','C:/Users/phild/Documents/phase_noise_408.dwf3work']) subprocess.Popen(['C:/Program Files/Digilent/WaveForms3/WaveForms.exe','-runscript']) At this point, Waveforms opens, and the specified workspace does load automatically now, which is good! 🤩 (Side note: I had to move the workspace to a different directory so that it could be found. Originally, it was in the same directory as WaveForms.exe, but it wouldn't load from there.) The script is still not running automatically though. Any thoughts on why the script isn't running automatically? Thanks, Phil ps: I am running Waveforms Version 3.8.2 32-bit Qt 5.6.3 Windows 7
  14. Hi @attila, Not sure if I should start a new thread, but I'm struggling with the stuff being discussed here. I'm trying to use Python to open a workspace and then run a script in the workspace. import subprocess subprocess.Popen(['C:/Program Files/Digilent/WaveForms3/WaveForms.exe', 'phase_noise_237.dwf3work']) subprocess.Popen(['C:/Program Files/Digilent/WaveForms3/WaveForms.exe', '-runscript export_data.dwf3script']) I want to open the "phase_noise_237.dwf3work" workspace, and then run the script "export_data.dwf3script", which is saved as a part of that workspace. Waveforms opens, but does not open the workspace. Then I open the workspace by hand, and then run the python code to run the script, it tries to open Waveforms again. Thanks, Phil
  15. Does the Waveforms spectrum analyzer have options for zero padding? I've seen in other FFT applications that increased zero padding can improve the look of an FFT at low frequencies when monitoring over a wide frequency range, like 10kHz to 20MHz.