Leaderboard


Popular Content

Showing most liked content on 09/13/2017 in all areas

  1. 1 point
    here is another version of the script i am working on, it does both channel it does scale the frequencies logarithmically it does the averaging if trace 1 type allows count to be enabled. it saves to a desktor CSV file for data manipulation in a speadsheet. //taken from https://stackoverflow.com/questions/846221/logarithmic-slider // and modified to suit my needs function logslider(position, maxp) { // position will be between 0 and 100 var minp = 0; //var maxp = 50; // The result should be between 100 an 10000000 var minv = Math.log(20); var maxv = Math.log(20000); // calculate adjustment factor var scale = (maxv-minv) / (maxp-minp); return Math.exp(minv + scale*(position-minp)); } function doTHD(){ var freq var slices =30 var rgTHD1 = [] var rgTHD2 = [] var rgFreq = [] for(var idx = 0; idx <= slices; idx++){ freq = logslider(idx, slices) Wavegen1.Channel1.Simple.Frequency.value = freq //Wavegen1.run() // start AWG Wavegen1.Channel2.Simple.Frequency.value = freq Wavegen1.run() // start AWG wait(0.01) // settle time for the external circuit, expressed in seconds Spectrum1.Frequency.Start.value = freq // adjust analyzer start frequencyTool Spectrum1.Frequency.Stop.value = 10*freq // adjust analyzer stop frequencyTool if(Spectrum1.Trace1.Config.Count.enable==true) { print ("averaging is enable"); var avg = 0 var avg2 = 0 for (i=0;i<Spectrum1.Trace1.Config.Count.value;i++) { Spectrum1.single() // start acquisition if(!Spectrum1.wait()){ // wait to finish return; } avg += Spectrum1.Trace1.measure("THD") avg2 += Spectrum1.Trace2.measure("THD") } avg /= Spectrum1.Trace1.Config.Count.value avg2 /= Spectrum1.Trace1.Config.Count.value rgTHD1.push(100*Math.pow(10,avg/20)) rgTHD2.push(100*Math.pow(10,avg2/20)) } else { Spectrum1.single() // start acquisition if(!Spectrum1.wait()){ // wait to finish return; } rgTHD1.push(100*Math.pow(10,Spectrum1.Trace1.measure("THD")/20)) //rgFreq.push(Spectrum1.Trace2.measureFreq("FF")) rgTHD2.push(100*Math.pow(10,Spectrum1.Trace2.measure("THD")/20)) } rgFreq.push(Spectrum1.Trace1.measureFreq("FF")) } Wavegen1.stop() print(rgFreq, rgTHD1, rgTHD2) // print data for copy paste var file = File("~/Desktop/THDvsFreq.csv") file.appendLine("Freq,THDN CH1, THDN ch2") for (i=0;i<= slices;i++) {file.appendLine(rgFreq+","+rgTHD1+","+rgTHD2)} // draw in plot1, View / Add plot plot1.X.Units.text = "Hz" plot1.Y1.Units.text = "%" plot1.Y2.Units.text = "%" plot1.X.data = rgFreq plot1.Y1.data = rgTHD1 plot1.Y2.data = rgTHD2 plot1.update() } doTHD(); thd1watt.bmp THD_vs_Power.dwf3script THD_vs_Freq_%.dwf3script
  2. 1 point
    jpeyron

    Cmod A7 Clocking

    Hi @etownsend, There is the option of adding a 100 MHz oscillator to the Cmod A7. Here is a forum thread that discusses this option. The oscillator would be added to IC4. You can see this in the schematic here on the bottom of page 3. This is a more complicated processes and requires removing R80 along with adding the oscillator to IC4. I would not suggest this option. The other two suggestions @sLowe referred to are different ways to generate a 100 MHz clock one using the Xilinx Clocking wizard here(my suggestion as well). The other is referring to @D@n suggestion of using a PLL(phase-locked loop) to generate a 100 MHz clock. Here is another forum thread that discusses generating a different clock using MMCM dynamic clocking(a much more complicated way). cheers, Jon
  3. 1 point
    @cnun999, Well, if you can't share your code, then there's not much I can do to fix it. Sorry. You might find it valuable though to take pieces out of it, and see if that helps you narrow down the problem--but I'm repeating myself to say this at this point. You might also considering entering into a contract arrangement with a more experienced designer, working some non-disclosure agreements through the legal team, and trying again. I'd offer my services to that end but ... I don't use system designer much. So, again, I'm sorry I can't be of much more help. Dan