Frequency response and phase difference

Hi,
 I generate "Sine-Swept" with a function generator, which is the input of my device.
Then, I measure the output(vibration) via a photodiod (which is as voltage).
Now, I want to obtain FRF and Phase difference between these two wave (output and input).
In most of the examples, the input and swept has been generated by the software itself, but if the input has been acquired externally and also the swept has been done via a function generator, how would be the FRF?
I have installed "Sound and vibration toolkit", Could you please give me a heads up, that how can I do that?
In advance, I really appreciate your help,
Petar

Hi,
I attached the project which I've recorded the data from DUTs. Also, I attached 2 snap-shots of the project, in case of the project file couldn't be launched.
I have connected the signal from a function generator to "ACH0" channel, and performed the swept-Freq in the output signal of function generator. (Red graph in 1st chart). Please note that the swept sine wave is generated via the function generator itself...NOT VI
The generated signal by the function generator is the input, which derives the oscillation of a drop,
A photodiode measures the oscillation of the drop via laser-scattering by drop vibration. SO....the signal generated by the photodiode is the "Response"....(white wave in 1st chart)(connected to "Ach1" channel.
Now, I want to obtain FRF, which the input is the signal generated by the function generator, and Response is the output of the photodiod'
As it's seen in the files...the FRF and phase difference is n't what is expected, also the coherence between in and output is zero!
Please help me out with this problem...
Thanks
Petar
Attachments:
12.seproj ‏419 KB
1.JPG ‏183 KB
2.JPG ‏177 KB

Similar Messages

  • Svt frequency response (mag-phase).vi

    Hello people
    I want to find out the peaks from the specrum which get from magnitude output of svt frequency response (mag-phase).vi.
    but I always get errors when I use the svl spectrum peak search.vi, it looks like the peak search.vi can not accept spectrum type such as frequency response spectrum.
    what can I do to find out the peaks@freqency from the magnitude output of svt frequency response (mag-phase).vi
    Thanks in advance
    Tim

    Dear Lisa,
    Are you still here for supporting.
    I have installed Sound and Vibration Suite 2011 (SV) to use with LabVIEW Professional 2009 SP1. I have a concerns.
    After I install SV to the computer and launch my VI in LabVIEW 2009, I could not find the SV menus to use (in block diagram windows). I found a link
    http://digital.ni.com/public.nsf/allkb/9A4BC69D802​AD4D9862574FA004F0C20
    for the same issue but I could not find the path as they mentioned. The addons SV still missing in the installed directory.
    by the way, I can follow the path to find out VIs that I currently need to use. However, some VIs have different name. For example
    I could not find  "SVFA Power Spectrum.vi" but "SVT Power Spectrum.vi"; "SVFA Magnitude and Phase to Real and Imaginary.vi" but "SVT Magnitude and Phase to Real and Imaginary.vi"
    Similarly, I could not find "SVT Frequency response (Mag-Phase).vi" but "SVFA Frequency response (Mag-Phase).vi"
    Do they have the same function? It makes me confused.
    and I could not find  "SVT FFT Spectrum (Mag-Phase).vi"
    Can you please explain me what should be the mistake while I installed SV 2011 (I can not find SV 2009 and for interation with UFF58 file, LabVIEW 2011 is required)
    Thank you so much.
    Thinh Vo

  • Frequency response and transfer function

    Hi
    What is the difference between transfer function vi in basic labiview frequency palette and FRF(Mag & Phase) vi in sound and vibration tool kit. Aren't the two vi's for the same purpose, but I am getting different results using these two vi's.
    Which vi should be used for calculating transfer function between two signals x and y.
    Ankit

    Hi Ankit,
    You are correct that the FRF (Mag & Phase) VIs are very similar.  The one provided with the Sound and Vibration Toolset has several extra features such as the Spectrum Info output. 
    For a given measurement with given settings you could choose either VI, however you should see the same result from both.  If you are not seeing the same result, I expect the input parameters are not identical.  Changining input parameters such as averaging can have significant impact on your results.  Verify that you have identical parameters and I expect you will be able to get your results to match.
    Regards,
    Jennifer O.
    Applications Engineer
    National Instruments

  • FRF- Phase difference

    Hi,
    I have acquired the input and output of my DUT. Both of them are as time-wave (Voltage).
    The input is from a function generator, and the output from a photodiode.
    Now I want to obtaine the FRF and phase difference vetween these two waves, Does anyone know how can I do that?
    Also, I have performed the sweep by the Function generator, too. so the input is Swept-freq.
    I have attached the project (Sound and vibration toolkit)
    Thanks
    Petar
    Attachments:
    12.seproj ‏419 KB
    1.JPG ‏183 KB
    2.JPG ‏177 KB

    For each bin frequency the Frequency Response Step returns the magnitude and phase of the response signal / stimulus signal. Your project already had this step. Only the data saved as a log in the project was available for us to look at. Using a Power Spectrum Step, it appears that you configured your sweep to output a signal from 10 Hz to 100 Hz, so that is the region of the FRF that we should examine. Because you are using a sweep, change the window in the Frequency Response Step to None.
    You may want to perform a longer sweep to improve frequency resolution and/or average several sweeps to maximize signal-to-noise ratio.
    Doug
    NI Sound and Vibration

  • Phase difference analysis question

    I know there are a lot of signal processing experts on this board and wish I could get some nice suggestions.
    I have a two channel data: one is the load signal like sine wave; the other is the response signal with a pulse in each load cycle. I am going to analyze whether there is phase shift for the pulse to the load signal. Visually it is very straightforward to "measure" the phase between load peak and pulse peak. But it's hard to code it. I believe there are a bunch of better ways for coding easily (I am considering cross-correlation). Since these are high frequency signals, the size of the data set is huge, which makes such processing time-consumming.
    Any suggestions? Thanks!!!

    I find the answer in the help. Thank you very much! Jay
    Extract Single Tone Information 1 Chan.vi
    "Takes a signal in, finds the single tone with the highest amplitude or searches a specified frequency range, and returns the single tone frequency, amplitude, and phase. You can use this polymorphic VI to analyze a waveform or an array of waveforms. "

  • Frequency response function modal analysis

    After reviewing the signal analysis functions in DIAdem I have realized them to be a bit limited for modal analysis.  I have a couple hammer impact tests that I need to process a frequency response function for, and since this is brand new to me I'm not seeing anything in the embedded function list that is going to help me.  I was wondering if anyone out there has a couple of pointers on generating a FRF plot for modal hammer impact tests.  I did notice that the ChnFFT2 command allows me to generate a transfer function, coherance, and FFT Cross Spectrum channels for analysis.  Though I might be confused and this may be everything I need.  My FFT2 settings are below.
    [code]
    FFTIndexChn      = 0
    FFTIntervUser    = "NumberStartOverl"
    FFTIntervPara(1) = 1
    FFTIntervPara(2) = 2500
    FFTIntervPara(3) = 1
    FFTIntervOverl   = 0
    FFTNoV           = 0
    FFTWndFct        = "Rectangle"
    FFTWndPara       = 10
    FFTWndChn        = "[1]/Time axis"
    FFTWndCorrectTyp = "No"
    FFTAverageType   = "No"
    FFTAmplFirst     = "Amplitude"
    FFTAmpl          = 1
    FFTAmplType      = "PSD"
    FFTCrossSpectr   = 1
    FFTCoherence     = 1
    FFTTransFctType  = "Spectrum H0"
    FFTCrossPhase    = 0
    FFTTransPhase    = 0
    Call ChnFFT2("[1]/Time axis","'[1]/H_1' - '[1]/H_4'","'[1]/A_1' - '[1]/A_4'") '... XW,ChnNoStr1,ChnNoStr2
    [/code]

    Standard modal analysis has something denoted as FRF.  I have a labview application note "The Fundamentals of FFT-Based Signal Analysis..."
    Frequency Response Function
    The frequency response function (FRF) gives the gain and phase versus frequency of a network and is typically computed as
    where A is the stimulus signal and B is the response signal.
    The frequency response function is in two-sided complex form. To convert to the frequency response gain (magnitude) and the frequency response phase, use the Rectangular-To-Polar conversion function. To convert to single-sided form, simply discard the second half of the array.
    You may want to take several frequency response function readings and then average them. To do so, average the cross power spectrum, SAB(f), by summing it in the complex form then dividing by the number of averages, before converting it to magnitude and phase, and so forth. The power spectrum, SAA(f), is already in real form and is averaged normally.
    Refer to the Frequency Response and Network Analysis topic in the LabVIEW Help (linked below) for the most updated information about the frequency response function.
    http://zone.ni.com/devzone/cda/tut/p/id/4278
    So the options for FFT2 are
    No
    DIAdem does not calculate a transfer frequency response.
    Spectrum H0
    DIAdem calculates the transfer frequency response by dividing the FFT of the output signal (A) by the input signal (E): FFT(A)/FFT(E). DIAdem averages the amplitudes of the individual transfer functions.
    Spectrum H1
    DIAdem specifies the cross spectrum and the auto spectrum for each signal pair. DIAdem calculates the transfer frequency response by dividing the averaged spectra: Middle(cross(A,E))/middle(auto(E)). DIAdem does not average phases, because phases can delete each other.
    Spectrum H2
    DIAdem specifies the cross spectrum and the auto spectrum for each signal pair. DIAdem calculates the transfer frequency response by dividing the averaged spectra: Middle(auto(A))/middle(cross(E,A))
    If you assign the values Spectrum H1 or Spectrum H2 to the variable FFTTransFctType, DIAdem averages and divides the cross spectra and the auto spectra and calculates the amplitudes last.
    Which state auto spectrum when FRF is power spectrum. 

  • MacBook core duo Sept. 2006  - the audio is a mystery.  Any analogue out has bass boost with bass distortion.  With digital out, by USB or Airport Express Airtunes, the frequency response is normal.  Somewhere, Apple put in an analogue bass boost.. why?!

    Since new, my Macbook core duo has sent all audio to all analogue outputs with frequency distortion.  Some physical hardware or firmware in the analogue section adds a bass boost to the frequency response of the audio....  And, this boost adds bass frequency distortion to most, if not all, of the audio analogue output.
    This happens for all audio sources, players, iTunes, videos, streaming audio/video, movies...  any sound source available to the Macbook.  No-one with whom I have talked about this problem, has ever heard of it.  Not elegant ideas for reducing it are to use equalisers on players and iTunes.  iTunes even has a preprogrammed "bass reduce" on its equaliser, as if it knows already that this inherent bass boost "feature" has been built into the Macbook, and cannot be defeated by the user.
    The digital audio is of sufficiently high quality to play well on a very good to excellent sound-system;  so, it's a shame someone has mucked around with the frequency response of the analogue conversion, by designing the frequency distortion right into the computer.  This motherboard, (which includes the sound-section), has been replaced, along with the speakers, and everything sounds exactly the same as it was before.
    To receive a flat frequency response and no frequency distortion, I listen on one receiver using Airtunes, (it doesn't matter whether or not the analogue or digital output jack is wired analogue or connected via optical cable....  the freq. response is flat);  and I listen on a high-end stereo system using an USB output port to an A/D converter, passing the analogue result using long patch-cords connected to the "line-in" jacks of the stereo.  The bummer is that most of my audio sources are not derived from iTunes...  hence, I cannot use Airtunes with Airport express for them.  I've tried using "Airfoil" without luck.  The sound becomes distorted with sibilance and other frequency anomalies.
    Question:  has anyone else discovered this sound imperfection in any Mac product?  And, does anyone know if Apple is aware of it?  Finally, has anyone found an Apple fix for the problem;  or, at least, come up with better solutions than I have?
    Thanks heaps for any impute and answers you may supply!!  junadowns

    Army wrote:
    This might not help you a lot, but if you want a stable system, try using packages from the repo wherever possible, look at the news before you update your system and don't mess things up (like bad configuration etc.).
    When it comes to performance, you won't gain much by compiling linux by yourself! Just use the linux package from [core] or if you want a bit more performance, install the ck-kernel from
    [repo-ck]
    Server = http://repo-ck.com/$arch
    (this has to go to the bottom of /etc/pacman.conf)
    (use that one which is best for your cpu (in your case this might be the package linux-ck-corex).
    Hmmm, Linux-ck-corex doesn't even load.. I am now trying to install the generic one. Hope it works.
    Edit: I will first try linux-lqx...
    Last edited by exapplegeek (2012-06-26 18:33:31)

  • Buil-in microphone frequency response graph

    I'm curious as to where I can find a frequency response graph for the built-in mic in the 15" MBP 2.8. I know it's a silly thing to want, but... Sometimes I don't have the time or resources to set-up an external mic with a flat frequency response, and would just like to use the built-in mic very quickly to "EQ" or "ring out" rooms. I can't find the info on the built-in mic anywhere. Any suggestions?

    Have you ever used the microphone? Have you ever actually used a laptop to do this?
    I don't have a graph, but from years of working with audio I can tell you that it doesn't have the frequency response, sensitivity and directionality to do what you want.
    A nice external mic and portable interface like the iMac would not only do a better job but would look a lot more professional than running around trying to point the cheap microphone of a laptop in the right direction.

  • Flat Frequency Response

    I probably shouldn't have to be asking this question since I charge people for my obviously amateurish recording abilities but it's one that I've never had explained to me and one I need to know the answer to......
    Let me set the question up this way:
    When you get in the car and pop in a professionly produced cd, most people crank the treble control up to 6-10 (on a scale of 10) and the bass up to (4-10) depending on the factory speakers and type of material and whether or not they care what their music sounds like. When you get home and you're listening to the much higher end home stereo still listening to that professionaly produced album, you still reach for those treble and bass knobs and crank them up several notches or if you have a graphic eq you tweak out a smiley face .
    There's so much emphasis in the recording world about getting a flat frequency response out of your room with absorbers and bass traps and spreading around the reflections with deflectors, etc...etc..etc..., that we spend thousands of dollars on this stuff and some measuring software to make sure that it's flat. Then we use that flat response to produce music that sounds great and expect that to translate to those cd players and home stereo systems.
    (I'll additonally preface my question by saying that I've had no problems getting my music to translate from my home studio to any other playback system, but I'm a little confused about what's going on.)
    Now finally my question(s), when we reach for those treble and bass knobs on our car and home playback systems, are we really just trying to make up for the lack of bass and top end in those systems so that we too can achieve a flat frequency response and make the music sound good on whatever system?     or
    Do we as listeners actually prefer the smiley face frequency response in music and are we taking a cd that itself has a flat frequncy response and making a smiley face out of it so that it sounds good to our ears? (Please don't give me a material/genre answer.)
    The reason I ask is because I have to put a graphic eq on my Truth 2031A monitors to make the professional stuff sound good through them, and then I in turn mix my music to sound the same for whatever material/genre of course. (I'm not really interested in any monitor bashers or I would've asked this over at Gearslutz.)
    So again rephrased...Do the masses think music sounds good when it has a flat frequency response or the smiley face and if it's the lattter of those, how are we supposed to achieve that when our home studio setup is producing a flat frequency response, do we tune our monitors with eqs like me?
    Additonaly I understand that when were talking about flat frequency responses in rooms we're talking about throwing sine waves through a system and ranging their frequencies, measuring them out so that we can detect any over emphasis/deficiencies in the room so maybe this question is a little more towards monitor tuning.

    If you look up Fletcher and Munson in Google, you might begin to get a bit of the start of an idea of why this isn't quite as straightforward as it seems.... and I'm not sure that I can give you a complete answer either, although I can give you a few connected but slightly random things to ponder, wearing my acoustician's hat:
    The fundamental problem is that when things are quieter (and less distorted, incidentally) our ears get more sensitive to the midrange frequencies, and if we listen to music that way, it invariably sounds as though the bass and treble are out of balance. In cars it's slightly different though; the frequency response of whatever's in there generally tends to be anything but flat - and often over-emphasises the midrange anyway. Treble tends to get absorbed very easily in upholstered cars, and since most car speakers don't have anything like acceptable tweeters in as a rule, it's not surprising that people want to increase the treble. As for the bass - well I'm always turning that down personally, but I know what you mean in principle!
    If by a 'commercial' CD you mean one where the vocal is prominent, then yes I can easily imagine why you might as a matter of course want to increase the response at the extremes - it makes sense if you think about it. The mid-range vocal is prominent and probably compressed, so its average level is louder than the backing - this helps it to stand out. But also it distorts the overall time-based response - the backing may well be balanced so it's okay on its own, but that doesn't always translate if you have the wrong vocal settings applied, or at a minimum, applied unsympathetically. And some voices make this significantly worse; for instance Sealion Dying (AKA Celine Dion) makes the most appalling racket in the midrange, and you'd definitely need less of that!
    So really I'd say that it's not a Bass/Treble issue, but a midrange one. If you look at commercial CDs in general, you tend to find that the energy distribution is pretty even over the whole audio band, which implies that it falls off at 6dB/octave if you look at it in Audition (this is an energy/Hz thing), but in reality most CDs these days are mixed a little brighter than that - more like a -3dB/octave slope down from about 1kHz, and that's partly to compensate for a lot of things - some of which are cars... You do have to watch out for the distortion issue though - most people don't realise, but you are able to tolerate rather higher levels of non-distorted sound than anything with significant distortion levels in it, and if that distortion is in the midrange, then you'll want it quieter anyway. So decent, over-rated under-run PA systems always sound cleaner and louder but you should beware - they can damage your ears just as much, if not more.
    Do car interiors themselves increase the chances of midrange boost occurring?  I think it's a pretty safe bet that they do, as a rule, simply because of the size of them, and the treble problem I already mentioned. And if you are trying to compensate for too much midrange, then the rest follows. Most domestic replay systems these days seem to be midrange heavy to me as well - I haven't heard anything cheap recently that had anything like a flattish response - and they really don't suit the rooms they are in either.
    If you want to listen to material as it really should be, then you need to experience it live first, I'd say, and then do a direct comparison with what you can hear in your monitors. I'm fortunate - I can do this quite regularly with a variety of material. Do I tend to leave things as flat as they are recorded? Well, it depends on what it is. If it's in any way classical, then sometimes I look carefully at the bass balance, but generally I leave the rest alone. Everything else these days I just get to sound good - and that can mean all sorts of tweaks, depending on all sorts of things. More and more though, I've come to the conclusion that too much midrange isn't necessarily a good thing - but that's mainly because of the general lack of good reproduction equipment around these days.
    As for monitors and flatness - well that's not really an issue for most people, compared to getting their listening environment correct. If you have a pair of cheap monitors in a good room, the chances are that the results will sound better than an expensive pair in an uncorrected room - despite what all the monitor freaks on gearslutz might say. These days, even the cheaper ones can sound quite respectable. But flatness isn't an issue with monitors really - a decent impulse response, and low distortion are far more important. Chances are that if a manufacturer has got this right, the monitor is going to be suitably 'revealing' anyway - which is what a monitor is supposed to do.
    The one thing you do not do though, is EQ the feed to your monitors - that went out of fashion almost as soon as it came in - fortunately. You fix the room so that it's more truthful. If you EQ the monitor feed it will inevitably only sound good in one place in the room, and that's no use to man nor beast. The only decent things that proper room correction systems can do is equalise the immediate time response to take account of what's actually between the monitors and you - which if done properly can improve stereo imaging no end.
    So answers? Well not really. But at least I've explained a few (but not all) of the issues.

  • Where can I find the amplitude and phase frequency response when the AC coupling is set on the 4472

    My friends,
      I need to know the amplitude atenuation but most important, the phase distortion introduced on the low frequency components of the signals when the AC coupling is setted (i.e. when the high pass filter is connected) on the 4472 and 4472B DAQBoard.
      I can construct the amplitude frequency response by generating and aquiring a sine waveform of a knew amplitude. But I cannot construct the phase distortion introduced by the circuitry. 
      However, I assume that this crucial information should be available in the DAQ Manual or  in the website of NI, but untill now I haven´t found it.
    Thankning in advance,
    crimolvic from Chile

    crimolvic,
    Here are the Specifications and Datasheet for the 4472.  They indicate a phase non-linearity of less than 0.5 degrees across all frequencies.
    For information on how this varies with frequency, see the attached
    spreadsheet.  This response was the result of testing on a single
    4472.  Although this is classified as a "typical" response, it is
    not gauranteed.
    Have a great, day!
    Travis
    Attachments:
    4472 Phase Linearity.xls ‏21 KB

  • Frequency response - sound and vibration

    Hi,
    I need to find the frequency response of the DUT. I am using the NI example from sound and vibration toolkit to do
    so (LabVIEW 8.5\examples\Sound and Vibration\Getting Started\SVXMPL_Getting Started with Swept Sine (DAQmx).vi) now my problem is
    to tabulate the phase difference between the stimulus and response when i do it i get constant values. Even though i dont give any response 
    signal to the channel i get the wave same as stimulus, is it suppose to be like that !!!!!!!!!! I will attach my vi so that it gives the idea where 
    i am measuring the phase difference pls check it and help me with this.....thank you in advance.
    Attachments:
    DAQ Freq resp (req)_trial.vi ‏121 KB

    What is the DAQ card you are using for executing this Frequency Response?
    This DAQ error is related to the output frequency of your signal higher than the possible output rate of the card. Basically, you are trying to update at a rate higher than the capability of the card.
    For doing Frequency response, generally you need to have a NI DSA card (446x/447x/449x) with one Analog output and two analog inputs (minimum). Generate the swept sine signal from the Analog output channel, give this signal as input to your DUT and also to one of the Analog input channel. This input to your Analog input channel will act as your Reference signal. Then the response signal from your DUT, connect it to another Analog input channel. You would get a very good response results.
    The reason why you need to have a DSA board is that, for doing Frequency response, we need to acquire both high frequency and low frequency components without much loss. This is possible only if your DAQ board has a higher dB value (in the range of >110dB) which is present only in DSA boards.
    I have completed a Frequency Response Analysis just a week back with the same example programs. So there wont be any problem with that vi.
    Regards,
    Sundar Ganesh

  • Better estimation of phase difference between two signals with variable frequency!

    Hello LabView Gurus, 
    Being a power engineer and having just a little knowledge of signal processing and labview, I have been pulling my hair out for the last couple of days to get a better estimation of phase difference between two signals.
    We have two analog voltage signals; 1. sine wave (50Hz ± 1Hz) and 2. a square wave with exactly half of sine wave frequency at any time.
    At the starting point of operation (and simulation/acquisition) both signals will have no phase difference. However, the square wave's frequency changes unpredictably for a just a few millisecond but then it gets synchronized with sine wave's frequency again. This means that the square wave will be phased out from its original position. The task of the labview is to find the phase difference between the two signals continuously.
    My approach to determine the phase difference is to measure the time when sine wave crosses zero amplitude and the time when the very next square wave changes amplitude from zero volts to +ve voltage (I have a 0.5volts threshold just to avoid any dramas from small line noise). The difference between these times is then divided by the time period and multiplied by 360 to get this phase difference in angles. 
    As this part is just a small block of a big project, I can only allow 5000Hz sampling rate each for both signals. I read 500 samples (which means I read data from 5 cycles of sine wave and 2.5 cycles of square wave).
    Now the problem is, as long as the frequency of sine wave stays constant at exactly 50Hz, I get a good estimation of the phase difference but when the frequency changes even a little (and it will happen in the real scenario i.e 50Hz ± 1Hz  and the square wave's frequency is dependent of sine wave's frequency), the estimation error increases.
    I have attached my labview program. From front panel, you can set the phase of square wave (between -180 and 0) and you should see the labview's calculated phase in the indicator box named 'Phase'. Then you can press 'Real Frequency' switch that would cause the frequency to change like it would in real operation.
    You can observe that the estimation error increases after you push the button. 
    All I need to do is to reduce this estimation error and make it as close to the actual phase difference as possible. Any help would be greatly appreciated.
    I am using LabView 2009 for this task.
    The application is for electric machines and the stability/performance of machines under different faults.
    Thank you for reading this far!
    Regards,
    Awais
    Attachments:
    v603.png ‏320 KB
    v603.vi ‏186 KB

    Jeff Bohrer wrote:
    Basic math gives me a bit of pause on this approach.  You are sampling at 50 times the frequency of interest so you get 50 samples per cycle.  your phase resolution is 1/50th cycle or 7.2 degrees +/- noise.  You will need to samlpe faster to reduce phase resolution or average multiple readings (at a time cost that is signifigant)
    Jeff- (Hardly Working)
    I am sampling at 100 times the sine wave's frequency and 200 times the square wave's frequency.  Increasing the sampling rate completely solves my problem. But since I am acquiring several other inputs, I cannot afford a sampling rate higher than 5kHz.
    F. Schubert wrote:
    I'm not a signal processing expert, but here my basic understanding.
    If you simulate sampling with 5kHz and a frequency of 50 Hz (and both are 'sync' by design), you always get an exact 5 periods. Any variation of your signals frequency gives you a propability to get 4 or 6 'trigger' events. That's an up or down of 20%!
    The one measure to reduce such problems is using 'window functions'. They don't fit your current approach (counting instead of a DSP algorithm), so this needs to be reworked as well.
    My approach would be to use the concept of a Locki-In amplifier. You need to phaseshift your ref-signal by 90°. Then multiply your measurement signal with the ref signal and the phase shifted ref signal. The obtained values for x/y coordinates of a complex number. Calculate the theta of the complex number (with the LV prim). Feed this in a low pass filter.
    The trick on this is, that the square wave has harmonics in it, in this you are interested in the second harmonic which is the sine wave.
    To get rid of the effect that the sync between sampling rate and ref signal frequency gives an error, you then can use the window I mentioned above (place it before the lock-in).
    For a design that really plays well, use a producer-consumer design pattern to get the calculations done in parallel with the DAQ.
    I suggest you to check on wikipedia for some of the keywords I mentioned. Go also for the external links which lead to great tutorials and AppNotes on the signal processing basics.
    Sorry, it's not a simple solution I offer and we will have quite some conversation on this forum if you follow this path. Maybe someone else knows a simpler way.
    Felix
    www.aescusoft.de
    My latest community nugget on producer/consumer design
    My current blog: A journey through uml
    An interesting view. the sine wave can indeed be looked as a second harmonic of the square wave. I will implement your idea and get back to you as soon as I get some results. But since I have very limited knowledge of signal processing, it might take me a while to get my hear around the solution you mentioned.

  • Frequency response vi and writing to lvm files

    I'm having trouble writing the magnitude y/x of the frequency response vi to an .lvm file.
    I don't get any samples in my file when I run the program.
    Any idea what I'm doing wrong here?
    Attachments:
    testernw.vi ‏381 KB

    Hi,
    If you place indicators immediately before and after the frequency response express VI, what do they show?  Are there any differences between the input data before and after the conversions are applied?  I tried putting together a simple VI that takes two simulated signals, inputs them into the frequency response graph, and then outputs it to a file.  It appears to work fine, as long as the two inputs are at a different frequency.
    What version of LabVIEW are you using?  Where specifically are you reading the 0 values?
    Regards,
    Lauren
    Applications Engineering
    National Instruments

  • Comparison of Phase Difference between Zero Phase and FIR Filtering

    Hi,
    I have a comma-delimited text file containing a 2D array in frequency domain. I would like 2 do a phase difference comparison between the original signal, zero phase filter and FIR filter with a cut-off at 1550nm and sampling of 0.01nm. Ouput will be a graph. I've tried to model after the example in LabVIEW but I can't seem to get the graph to display. Is there an error in the block diagram?
    Also, is it possible to do the phase difference comparison via detection of central wavelength? If so, how can I go about it?
    Thanks.

    When you translate time domain to frequency domain, amplitude information is separated information.
    Therefore, there's no way to find phase information from frequency domain data.
    You must collect time domain data in order to perform this test.

  • Calculate frequency response using FFT and inverse FFT

    Hi,
    Attached is the program using FFT and inverse FFT to filter a time domain signal. The frequency response of the LPF can be obtained by using the chirp signal from 0 to 5kHz. However, I don't know why the signal obtained from a sine wave input is so strange. The amplitude is wrong and has a envelope outside. Please help to point out what's wrong with that.
    Bill
    Attachments:
    fft filter.vi ‏87 KB

    If you check the help text for sine wave.vi you'll see that it generates the sine wave based on the following formula:
    yi = a*sin(phase[i])
    for i = 0, 1, 2, …, n – 1 and where
    a is amplitude,
    phase[i] = initial_phase + f*360*i
    This means that when you input a=1, f=0,1 and initial_phase=0 you will get a sine wave that is based on samples at every n*36 degrees; i.e. at 0, 36, 72 etc...due to this sample rate you never see the full amplitude (+/- 90 degrees), the wave is clipped at the top. If you input an initial phase of 64 degrees you will get the full amplitude, but the wave is still deformed due to digitalization...
    The lower the frequency you put in, the closer the digitalized representation will be to the true sine.
    Use the Waveform Generator VIs from the analyze palette if you want to have more control over the wave generation (sample rates etc.). (Not available if you have the base package.)
    MTO

Maybe you are looking for

  • Error while uploading MT940 format

    Hi Experts, While uploading MT940 format file through t.code ff_5 following error come: External transaction N155 + and N475-  is not found. What these external transactions stand for and what should be the posting rule and interpretation alogrith fo

  • Reduced quality of .vob and avi files

    Hi Guys I need some help please. I am working on a trail version of adobe elements 10 on a new macbook pro lion. No problem installing application. When I import video either in vob from dvd or avi format, the quality of the video is reduced tremendo

  • Error : Creating PO with reference to Contract"CALL_OFF_CREATED"

    Hi Experts, I am working on Extended Classic Scenario, We have created the Contract document in SRM and it replicates to ECC system successfully. While converting the contract document into Purchase Order document in the SRM system we are facing this

  • Limitations of RFC Adapter XI 3.0

    In this presentation ( https://www.sdn.sap.com/content_documents/.../SAP%20XI%202.0%20-%20Features.pdf page 20), the following limitations are listed for the RFC Adapter for XI 2.0: Functionality Synchronous RFC   No support forRFMsthat use update ta

  • SQL Query with Date Range

    I have a query that will retrieve order between selected dates. It works great but returns no record if the 2 dates are the same. Example: Orders between 9-1-2010 and 9-30-2010 retunes 35 records. But if I select between -9-25-2010 and 9-25-2010, so