Repaints bumpy with spectrum analyzer component?

Hi everyone,
I have created a spectrum analyzer component for the MP3 player part of my open source application Playlist Editor. It works quite well but I currently struggle with some strange paint 'behaviour'.
The component constantly paints amplitude values for a number of frequencies during playback. But although repainting is controlled by a Timer object so that repaints are equally distributed over a given time interval the repaints are done quite bumpy, even with more than 30 repaints per second.
I have done plenty of testing without finding an explanation or solution. I finally prepared a preview of the appliciation with all sources included and a detail description of the issue.
Perhaps I made a completely trivial mistake and there is a simple way of doing the painting differently?
Anyone interested in looking into the component could you please visit http://www.lightdev.com/page85.htm and give it a try?
Your help is most appreciated. Thank you for any help!
Ulrich

I think something in the rendering
cycle must be programmed incorrectly,well, that is what I try to locate...; here is what tests have proven meanwhile
java.util.Timer is not accurate enough to trigger repainting at a constant rate faster than approx. 300-500 ms
with an own timer using the new System.nanoTime() method it is possible to call a method more exact, for instance every 150 ms or even every 10 ms
a call to drawImage takes approx. 0.22 - 0.25 milliseconds
calling drawImage more often than every 150ms does not lead to faster repaints so far (i.e. paints are done approx. every 150ms although drawImage is called more often)
the rendering of such a small component
should also be able to reach at least 10 FPS
(possibly even 50-60 FPS)that is what I got from the document too, but the question is whether or not this can be done with 'normal' calls to paint() or drawImage() or whether there is another mechanism one can/has to use inorder to exectute calls to redraw an image more direct/imediately....
from the other test figures it shows that neither the FFTs nor other computing inside the application take so much CPU load that it would be necessary to put these functions out for testing. There is plenty of CPU time left for faster painting but something stops the calls to drawImage from being executed faster than approx. every 150ms
I'll keep everyone posted with new results but still anymore insights to painting and especially some more direct painting is most welcome!
thanks a lot best regards
Ulrich

Similar Messages

  • Interfacing labview 8.5 with spectrum analyzer

    can anyone tell me how to interface labview 8.5 with spectrum analyzer.............i am beginner ...i don't know much about labview
    Solved!
    Go to Solution.

    Why don't you tell us what you do know so we can better help you out?  Do you know how to hook up the spectrum analyzer?  Make/model of the spectrum analyzer?  Do you know how to use it manually?  Do you know what a spectrum analyzer is for?
    I know some of these questions might sound almost insulting, but we have to establish a baseline so we know how much help you need, and how much detail to include. 
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Iberr = EABO(6) with spectrum analyzer

    hello every body
    I am new user of labview, I sucess to make the connection between a PC and SPECTRUM ANALYZER R3361C but I cannot read or write data from SPECTRUM. In addition, I tried all the value of time out I dont success to read and write. 
    After l'execution, I have this message
    iberr = EABO
    EABO indicates that an I/O operation has been canceled, usually due to a timeout condition after a GPIB read.  Before reading from the instrument, verify that the GPIB command you are sending is understood by your device and instructs it to place data in its output buffer.
    Please Help Me
    best regards.

    The first thing to know is whether you are using an NI GPIB board? If you are, I'm assuming that you have already tested it in MAX (Measurement & Automation Explorer). After that, did you right click on the board under devices and interfaces and select 'Scan for Instruments'? Does your instrument appear in the list over on the right side of the screen? If it does, is there an instrument description present or does it say something like 'instrument did not repsond to *IDN? query'? If MAX fails to find the instrument, is there another instrument you can connect to determine whether the cable or GPIB board is faulty? If another instrument works, check the manual for the 3361 and see if there is something that needs to be turned on to enable GPIB communication. Some instruments have a menu item that needs to be enabled first. If all of this works, then you can attempt to communicate to the instrument. I have no experience with the 3361 and cannot find it on Advantest's web site. It is the Avantest spectrum analyzer isn't it? If the instrument did respond to the *IDN? query, and you can't get it to repsond to others, then you have a problem with the actual commands you are sending or with the way the instrument is setup.Message Edited by Dennis Knutson on 10-09-2006 07:29 AM

  • "agesani Initialize With Options" timeout error on HP E4401B spectrum analyzer

    System: Windows XP Pro, LabVIEW 7.1, IVI Compliance Package 3.0, NI-VISA 4.1
    I have an HP E4401B Spectrum Analyzer.  I'm trying to write some LabVIEW code for it, using the agesani.llb library.
    When I try using the agesani Initialize With Options VI, I get the following error:
    Error code: BFFF0015
    Source: agesani Initialize WIth Options.vi<ERR>Driver Status: (Hex 0xBFFF0015) Primary Error: (Hex 0xBFFF0015) Timeout expired before operation completed.
    I've searched the NI Knowlege Base, and haven't found anything that seems useful.  What I _have_ found are the following items.
    Knowlege Base article "Time-Out Error with the Agesa Instrument Driver Example".  This refers to the agesa drivers, not the agesani drivers.  It also references an E4440A spectrum analyzer, not an E4401B.  The article says one cause could be that a compatibility mode other that SCPI is in use.  While the articles says how to fix this on an E4440A, the fix does not appear to apply to the E4401B.  In fact, if it is even _possible_ to have a mode other than SCPI on an E4401B, I can't figure out how to do it.  A second possibility the article suggests is that the spectrum analyzer is in Phase Noise mode rather than Spectrum Analyzer mode.  My E4401B is in SA (spectrum analyzer) mode.  I don't even see a way to put it in any other mode - I don't think the required options are installed.  Finally, my VI is configured as the article states - ID Query YES, Reset Device YES, etc.  I should note that the instrument's GPIB address is 18, and that this matches the resource name GPIO0::18::INSTR.
    Some additional information: The spectrum analyzer's screen is indicating the instrument is in Remote (R) mode as a Talker (T).  A "Query UNTERMINATED" error message appears at the bottom of the instrument screen.
    I've attached the results of a NI Spy capture to this message. (At least, I think I have. I've never tried doing this before, so if it doesn't show up, would some kind soul tell me how to include an attachment to my post?)
    Oh, yes.  The agesani version is driver version 1.1, updated 17 Aug 2007.  (The version that's currently on the NI download site.)
    Attachments:
    Capture4.spy ‏9 KB

    Hi MXI Master,
    If there's an instrument timeout, I haven't been able to find it yet.  Seems like there should be, so maybe I just haven't looked in the right place yet.  As for the timeout value on the computer, I'm not sure what you mean by this - could you elaborate, and maybe tell me where to find it?
    As far as SCPI mode, if it's possible to put the E4401B in something _other_ than SCPI mode, I haven't figured out how.  I can't find any support in the programming manual for anything other than SCPI.
    That kind of seques into my next couple points.  The NI Spy output indicates that one of the commands that is being sent is "*SRE 32".
    The "User's & Programmer's Reference" for the E4401B says (on page 206) "Send the *SRE <number> command (where <number> is the sum of the decimal values of the bits you want to enable plus the decimal value of bit 6).  [Bit 6 is the Request Service (RQS) Summary Bit.  BP]  For example, assume that you want to enable bit 7 so that whenever the operation status summary bit is set to 1, it will trigger a service request.  Send the *SRE 192 (128 + 64) command."
    This statement would seem to imply that the "*SRE 32" command that is being sent by the agesani "Initialize With Options" command is an illegal command, or at best an ineffective command.  In light of that, it is interesting to me that the NI Spy output indicates that the next line , viQuery(GPIB::18::INSTR (0x246E9C8), "%s?","%ld"), is generating an 0xBFFF0015 error.  In addition, I can find neither the "%s?" nor the "%ld" commands listed in the Programmer's Reference.  I wonder if these could be for a firmware revision later than mine (A.01.03), or for instrument options I don't have (A4H, A4J).  Alternatively, I wonder if these are simply mistakes.
    The next line in the NI Spy output, Formatted viWrite(CPIB0::18::INSTR (0x0246E9C89),"INST:NSEL?",11,11), also puzzles me.  The Programmer's Reference indicates that this is a supported command, to see what instrument application is currently selected.  (e.g. spectrum analyzer, GSM, Bluetooth, EDGE, noise figure, etc.)  However, when I try to issue this command to my instrument, by using the Instrument I/O Assistant Express VI, I get an "Undefined header" error on the instrument's front panel.  The instrument's error history shows the same "Undefined header" error.  Since my instrument only has the basic spectrum analyzer option installed, I wonder if this command is not valid?  (Personally, I wouldn't write instrument firmware code this way, but who knows?)  Alternatively, I wonder if this command requires a firmware revision more recent than mine.  (The Programmer's Reference is silent about this possibility.)
    The next line in the NI Spy output, Formatted viRead(GPIB::18::INSTR (0x0246E9C8),"",4000,0), has another 0XBFFF0015 error associated with it.
    Does this information shed any more light on the situation?

  • WCS 4.2: Will Fluke spectrum Analyzer work with WCS?

    Does anyone know if WCS can use (as a Spectrum Expert) Fluke's Spectrum Analyzer software (The same OEM as Cognio)?

    thanks. Please clarify: is that Contact Center Express or Cisco Compatible Extensions, And how do either one of those show me if a spectrum analyzer with interface with WCS (added into the WCS interface as a SA)?
    I can find no 'page' that has that info.

  • Spectrum analyzer with sim and DAQ IV File

    Hello..
    i have a project that i need to design a Spectrum analyzer with simulation mode and DAQ option. ( so you can generate input signal from LabView and DAQ.
    all i look for is a modern Spectrum anlyzer VI file for reference and education purposes
    i know there are examples out there in LabView but, i need a modern one with a lot of options and features ( like Impulse respond, marker... filters.....)
    there is something i found here on the website, it happen long time ago, and some proffessor from Vietnam created such project. its not with DAQ, but its great for me.
    here is the link:
    http://digital.ni.com/worldwide/singapore.nsf/web/all/42B390E4624228D486257249001A5349
    this kind of Spectrum anlyzer looks great
    most appreciate for any help

    Hi Eldad,
    Thanks for posting and welcome to the NI forums!
    The
    application you have linked uses LabVIEW to control a Tektronix TDS220
    over RS232 (a.k.a. serial port).  The TDS220 has a 1GHz sample rate
    with a 100 MHz bandwidth--the specs on our DAQ devices don't go nearly
    this high, our High Speed Digitizers
    would be a better option if you need something comparable.  Also, the
    programming of the two devices (TDS220 vs. DAQ) is going to be quite
    different, so I am not sure how helpful the code from the link would be
    for your application.  I don't have access to the code or permission to
    post it here, but you could always try contacting the original author
    (his contact info is in the link you provided, not sure if it's up to
    date or not).  Again, I'm not really sure how helpful the code would be
    for you.
    You might want to take a look at the following example to see if it does what you need:
    NI-DAQmx: Benchtop Spectrum Analyzer
    There
    are also numerous examples that are installed with the DAQmx Driver to
    help you get started with the API.  You can access them from LabVIEW by
    going to:
    Help >> Find Examples... >>  Hardware Input and Output >> DAQmx
    There
    may not be a ready-made example that will do everything that you
    require, but the above should give you a good starting point for
    implementing the necessary features yourself.  If you run into any
    specific issues while trying to program, please don't hesitate to post
    to the forum and we'll be more than happy to help out.
    -John
    John Passiak

  • Premiere Pro Equalizer with Frequency Spectrum Analyzer?

    hi everyone, does anyone have the 411 on how to get a visual spectrum analyzer working with any of the Premiere Pro audio EQ's>?   There is a very nice EQ in the audio effects of Premiere, but when i play my files, the playing frequencies are not displayed on the EQ interface ... it's one thing to adjust the EQ by ear, but it would be really helpful to SEE what frequencies are blown out or what have you.
    Thanks! 

    I think you will have to use audition for that

  • Spectrum Analyzer with Tracking Generator - do I have what it takes?

    Hi Guys and Gals,
    I need to profile the response of some filters in an ultrasonic bit of hardware. I've been told that a Spectrum Analyzer with a Tracking Generator will do what I want in a short space of time, but I don't have one. Problem is I don't know what a spectrum analyzer is (beyond the obvious - analyses the frequency spectrum response).
    I have a 100MHz Arbitrary Function Generator under LV control and I have a LeCroy 600MHz Oscilloscope under LV control and I know a bit about writing LV.
    The question is, can I use the AFG, the Oscilloscope and LabVIEW to make myself a Spectrum Analyzer to do the job?
    Any suggestions or pointers gratefully received.
    Dr Phil

    I believe a Network Analyzer will be of use to you, and fortunately you have the makings of one.  A NA will tell you the amplitude and phase response.  The easiest thing to do is to split the signal from the AFG (use a T) and send one signal straight to the scope and the other to the input of the DUT (device under test).  Connect the DUT output to the second channel of the scope.  Simply measure the ratio of the amplitudes and the relative phase of the two channels and you are all set.  The scope probably has these functions built in, otherwise acquire the time series and let LabVIEW do the work (you can also take the power spectrum if you really want a spectrum analyzer).   If you want to be careful, make sure that the cable lengths in the two paths are equal, but at ultrasonic frequencies I wouldn't worry about it at all.
    -Darin

  • Spectrum Analyzer with NI-6111

    I am trying to build a two channel (simultaneous) spectrum analyzer using Labview 7.0 and the PCI-6111 DAQ. I can make one channel work but it is very slow, but cannot find a method to acquire the second channel while the first is running. Are there any samples that might be useful? Attached is what I have so far. Is there anything I can do to speed it up? Any suggestions are GREATLY appreciated.
    Attachments:
    Acquiring_a_Signal_with_FFT_&_DAQ_&_THD_&_OCTAVE_&_TAB_&_CASE.vi ‏452 KB

    I've attached an example that I've thrown together that acquires from two channels and performs an FFT of one or both channels (selectable). I didn't have a problem performing frequency analysis on multiple channels simultaneously. One thing to keep in mind though -- the more analysis you do while performing buffered acquisition, the more likely your CPU will run into trouble with transferring data. I hope my example helps.
    Regards,
    Todd D.
    Attachments:
    Example.vi ‏201 KB

  • Digits truncated in GPIB read with HP 8593 spectrum analyzer

    When I read the information from the HP spectrum analyzer, only the first digit is read .
    It works fine with other instruments

    Can you provide some sample code of what you are doing?
    What instruments does it work for?
    By digit do you mean one bit, one byte, or one reading?
    Were you expecting one reading or an array of readings?
    [email protected]

  • Obtaining Screenshot from Spectrum Analyzer - Not able to view the image created

    Hello,
    I am using the following code snippet in my program to get the screen shot from  Agilent Spectrum Analyzer , I am able to get a gif image created in the location specified but when i opened it I could not see any result.
    Please help out . I also tried with Interactive Utility still the same result , Am i missing something here or is there anything for me understand . please let me know.
    ibwrt(DeviceHandle,":MMEMTORCR 'CICTURE.GIF'",30);
    ibwrt(DeviceHandle,":MMEMATA? 'CICTURE.GIF'",28);
    ibrdf(DeviceHandle,"C:\\PICTURE.GIF");
    Thanks
    Meeran

    Dear Bala,
    I have got about 8 to 10 DC's out of which only this one is showing the missing structure and as this dc is being used by other dc's I am getting the error like missing component.  Previously we were using the client desktop and doin the work now we have shifted it to our individual systems.  Now any project I am creating whether from same track or different same problem comming the structure is missing.
    Regards,
    Ganesh
    Edited by: Ganesh Sawant on Sep 8, 2009 9:42 AM

  • How to read the data in spectrum analyzer (Anritsu MS2661C) and put it in Excel using Labview

    Hi all, I'm new to using the labview, and I have some trouble doing my project using the labview software.
    I have been trying to use the spectrum analyzer (Anritsu MS2661C) which connect to computer using the GPIB connection.
    I have got the instrument driver which can write and control the instrument using Labview 2010.
    and my Question is how do read the data or result from the spectrum analyzer and send it to the microsoft excel?
    Do I need to use other software or programming to do this step?
    If anyone know how is this done, please let me know.
    Regards,
    Ery

    Hi ery,
    In order to send data that you have read in from an instrument to Excel, the most convenient way to do this would be to use our Report Generation Toolkit.  The Report Generation Toolkit is a very useful tool that allows you to interface to Microsoft Office software from LabVIEW, including Word and Excel.  I am not sure if you are familiar with this, but I have attached a link that explains more about the Report Generation Toolkit below.  
    Another way would be to use the Write To Spreadsheet File VI.  While this will store your data to a spreadsheet data file, it will not allow you to programmatically perform any Excel formatting like the Report Generation Toolkit offers.  I have also attached a link to some information on the Write To Spreadsheet VI below.  
    Also, be sure to check out the Example Finder in LabVIEW for a number of examples on how to write data to a spreadsheet file.  From LabVIEW, you can go to Help»Find Examples to launch the Example Finder.  From there, you can search for "spreadsheet," which should populate examples for use in different applications.  I hope this helps, ery.  Please let me know if you have any further questions about these!
    NI LabVIEW Report Generation Toolkit for Microsoft Office
    Write To Spreadsheet File VI 
    Taylor G.
    Product Support Engineer
    National Instruments
    www.ni.com/support

  • Labview driver for HP 8560 EC Spectrum Analyzer

    I'd appreciate it very much if somebody help to find
    Labview driver for HP 8560 EC Spectrum Analyzer using GPIB.

    Unfortunately I was unable to find a driver for this instrument either. This leaves you with one of a couple options. First, I would like you to submit a request for this driver at:
    http://zone.ni.com/idnet/other.htm
    We develop drivers based on demand and popularity so the more requests we have for it, the greater the possibility that we will develop one.
    If you would like to try developing your own instrument driver (or modify the existing one), we have documentation, model instrument drivers, and driver templates to help at :
    http://zone.ni.com/idnet/development.htm
    We also have a syndicate of third party vendors that specialize in National Instruments' products and services. Some of the vendors specialize in driver development. I would sugg
    est contacting one of the Alliance members at:
    http://www.ni.com/alliance
    Good Luck.
    Kim L.
    Applications Engineer
    National Instruments

  • Sound Input Read Spectrum Analyzer

    I am working on a project with Arduino to do a spectrum analyzer. The LVIFA part of it is working fine.
    The part that I am struggling with is the audio input.
    I am using the Sound Input Pallet.
    My troubles are two-fold.
    1. A single read takes quite some time and I need to have a pretty quick response. I decreased the samples per read and came up with problem #2.
    2. I can get one read out of the Sound Read In and then the VI locks up. I have my timeout set to 1 Sec and it never times out. I have to restart LabVIEW.
    While it would be nice to have this VI working, I'm not even sure that I am using the correct tool. If I am going to be running an audio spectrum analyzer display off of the data input, I need to response to be within a few mS (ie. <200) so that it looks visually correct.
    If this library will not achieve this, then I need to look into a different tool.

    Hi,
    I have a similar project, actually I am using a Audio frequency range as input to the Arduino and do an FFT to receive the spectrum out of it.
    See the YOUTUBE video I did and the code in *.jpg. I took actually the Continous Input example and modified it.
    Hope that helps.
    Keep me posted, since we might work on a same project.
    http://youtu.be/aqzyofQHXDM
    Y3G
    Attachments:
    Uno Blockpanel.JPG ‏104 KB
    Uno FRONTpanel.JPG ‏99 KB

  • LabView drivers for Agilent 54830B scope or E4402B Spectrum Analyzer?

    Where can I find LabView drivers for the Agilent 54830B scope and the E4402B spectrum analyzer, or at least a driver for another instrument in the same families that I could modify? There are none on the NI site or the Agilent site.

    One thing that I have done several times is get a LabWindows CVI
    driver from Agilent. You will be provided with a .fp file. LabVIEW
    has a link under the Tools>>Instrumentation menu that allows you to
    "Import CVI Instrument Driver." This will take the function calls
    from CVI and build a set of VI's with the same name. The vi's will be
    wrappers for a dll that is used by CVI and other text based languages.

Maybe you are looking for