
Re: Passband Intermodulation
AlanStevens Oct 6, 2010 1:58 PM (in response to BillDumke)Don't you just need to put subscript f on variables p1 and p2 where they occur on the righthand side of Kf?
Alan

Re: Passband Intermodulation
BillDumke Oct 6, 2010 2:09 PM (in response to BillDumke)When I do that I get a "This value must be a vector".
Bill

Re: Passband Intermodulation
AlanStevens Oct 6, 2010 2:21 PM (in response to BillDumke)See attached. Since I don't know much about passbands it might not make physical sense! However, it works in Mathcad (M15) without any error messages.
Alan

Re: Passband Intermodulation
BillDumke Oct 6, 2010 2:29 PM (in response to AlanStevens)Thanks for the idea. I hadn't thought about opening it in Mathcad 15. No error messages, but the plot isn't right either. I will try spreading the frequencies out a little. Maybe they are too close together, for it to display properly.
Bill

Re: Passband Intermodulation
BillDumke Oct 7, 2010 8:18 AM (in response to BillDumke)One BIG mistake I made with the passbands, is I multiplied and subtracted the amplitudes, NOT the frequencies. I think it will work if I use vectors of individual frequencies for the passbands.
Working on it.
Bill

Re: Passband Intermodulation
BillDumke Oct 7, 2010 1:45 PM (in response to BillDumke)Here is the solution.
Bill

Re: Passband Intermodulation
LouPoulo Oct 7, 2010 1:46 PM (in response to BillDumke)Take an example IMD term from the sinusoidal version: a1*a2*a2*cos[ (2w2+w1)*t]. The generalization for rectangular spectra is to have a1 and a2 be (baseband) time functions rather than constants. They may have rectangular spectra or any shape.
Define the spectral bandwidth of a1(t) and a2(t) to be bw1 and bw2. Multiplying functions in time corresponds to convolution in freq. domain. Thus the sample term above has a bandwidth defined by the convolution [ a1(t) convolve a2(t) convolve a2(t) ]. The spectral bandwidths add when spectra are convolved. Therefore, this example term has a spectral bandwidth of bw1+2*bw2 centered at f = 2*f2+f1 . Each term in the expansion is treated similarly. Clearly, the maximum spectral width of the third order terms is 3*bw1 or 3*bw2 , whichever is larger.
The same principles apply to higher order IMD.
In the sheet, the attempt to create rectangular spectra is wrong. See comments in attached.
Lou

Re: Passband Intermodulation
BillDumke Oct 7, 2010 1:56 PM (in response to LouPoulo)Lou,
Thanks for the help. I hadn't thought about doing it that way, but I am sure you are correct. Do you have an example done with convolution? It would be desirable to get the amplitude variation out as well.
Bill

Re: Passband Intermodulation
LouPoulo Oct 12, 2010 7:12 AM (in response to BillDumke)I don't have specific examples worked out, but it's fairly straightforward to do it (or look it up) for the case of a rectangular spectral envelope. Convolving a real, rectangular spectrum of width w with itself gives a triangular spectrum of total width 2w. Convolving again with the rectangular envelope gives a bell shaped spectrum (with parabolic segments) of total width 3w.
The usual caveats apply: specific cases with complex spectra may not come out like the textbook cases, any other IM compponents that may overlap can change the resulting total spectrum,etc.
Lou

Re: Passband Intermodulation
BillDumke Oct 12, 2010 1:54 PM (in response to LouPoulo)Lou,
How do I subtract frequency passbands using convolution in the time domain?
See attached.

convol pulses.mcd.zip 7.7 K

Re: Passband Intermodulation
BillDumke Oct 13, 2010 10:54 AM (in response to BillDumke)I need to find the amplitude variation of 3rd Order Intermodulation Products from two rectangular passbands as well as their bandwidth. Maybe my previous posting was confusing. So I am posting another Mathcad 11 document that shows my failed attempt to follow Lou's recommendation. Multiplying D by just the A passband does not help either because the vectors A and D are different sizes.
Thanks for any help on this.
Bill

Re: Passband Intermodulation
BillDumke Oct 13, 2010 11:14 AM (in response to BillDumke)I tried different size sets of discrete frequencies for A and B by just multiplying and subtracting the frequencies directly for 2BA. When all permutations are looked at, the amplitude of the intermod products near the center of the 2BA passband grow in amplitude because there are many permutations that land on the same frequency. The results for 2BA 3rd Order Intermodulation is attached. But I want to be able to do this with rectangular passbands as well.
Also it does not appear like the result using 12 discrete frequencies for A and B is "bell shaped" at all. So I am confused about whether convolution would present a valid result.
Any help on this (convolution or otherwise) is appreciated. Please see my previous post.
Bill

Re: Passband Intermodulation
LouPoulo Oct 15, 2010 10:49 AM (in response to BillDumke)The function 'convol" in one of your sheets doesn't work for me. It's not in mcd11 as I have it; likely in an extension pack that you have. The latest has way too many terms to look at. Regardless, I put together a simple example of a signal with two comb spectral sections. The spectrum of the 3rd order IM products has the expected bell shape. You may be able to build on this to do fancier or more complicated models. It may also help guide you to determine why your examples don't show the expected shape.
Some general suggestions on the sheets and your approach. The statement I made earlier that the spectral shape of an IMD term is the convolution of the corresponding envelope terms is valid. If you are going to use the baseband envelopes (not explicitly defined in the attachment example), then the spectral position of that term needs to be separately calculated based on the carrier term. Alternately, you can calc the spectrum of the full signal, as per the attached example.
I recommend that you go through some simple examples by hand, the old fashioned way using pen and paper, so that you have a good understanding of the underlying math. The mcd sheets should be used to extend this to the more complex, real examples you are really interested in. It will be the basic understanding that will let you know if what the mcd sheet is reasonable, and whether the implemetation has errors.
Regarding implemetation, I personally prefer using vectors instead of range variables wherever possible. Also, I try to keep the coarseness of quantization (how many points to use)  the conversion of a continuous problem (as here) into a discrete approximation  separate from the physical parameters of the problem. This makes it easier to change the accuracy of the approximation without changing the underlying physical parameters. In the attached example, The time resolution is defined by the sampling freq fs. The spectral bands are not defined by fs, but rather by their own parameters.
This is about all I can do for now; hope it helps.
Lou

IM example.mcd.zip 19.9 K

Re: Passband Intermodulation
AlvaroDÃaz Oct 15, 2010 11:55 AM (in response to LouPoulo)Lou Poulo wrote:
The function 'convol" in one of your sheets doesn't work for me. It's not in mcd11 as I have it; likely in an extension pack that you have.
Hi Lou. Can find an implementation for mc11 at http://communities.ptc.com/servlet/JiveServlet/download/341103574/convol%20function.mcd in http://communities.ptc.com/message/34105Regards. Alvaro.

Re: Passband Intermodulation
BillDumke Oct 15, 2010 1:01 PM (in response to LouPoulo)Thank you very much, Lou.
That is what I wanted, and it looks like it will work fine for any order of intermodulation or number of signals as well.
I guess I must have left something out when I did the all possible permutations of discrete frequencies earlier.
It looks like I can do a genfit of the Intermod expanded view result with a gaussian and then multiply that times white noise to simulate the effect of interference on another broadband OFDM signal at a frequency within that passband. It won't be a perfect simulation, but it should give me an idea of what would happen.
Convolv is part of the Signal Processing ebook for Mathcad 11. Alvaro graciously gave a link that describes it's definition. I thought it came free with Mathcad 11, but maybe I am wrong. (My memory isn't that great.) The Signal Processing ebook does come free with Mathcad 15 now.
I would also like to do the same for two signals of different passband widths. But I will try and play with what you sent to see if there is a way I can do that. It apppears to me the major stumbling block will be with the k term in the summation. N1 in the summation seems to define the passband width no matter what the lowest frequency is defined as for a given passband.
Eventually I would like to be able to take an FCC Spectrum Mask for LTE (broadband cellphone internet) or DTV (digital television) for example and use that for one or both of the two signals.
Any suggestions are very welcome.
Bill

Re: Passband Intermodulation
LouPoulo Oct 15, 2010 1:23 PM (in response to BillDumke)I assumed that the convolve was part of an extension pack. I have homemade convolve fcts., but I didn't have time to use them in a debug mode.
The two combs comprising the time function in the example have the same # of freq's since they are created with a single summation. Create whatever you want, using as many terms as you wish or any functional form. This is just the place to define your time function. It can have separate summations with distinct bandwidths and #'s of terms, and can be mixed with envelope*carrier terms. You can add noise as time functions here as well. There's really no limit.
I used half Hz resolution (or intended to) since I created signals with freq components at 1 Hz spacing with possible 0.5 Hz offset (from N/2). You may want to pick the sampling freq differently depending on the particular parameters of your problem. In any case, the example was intended to give you a starting point.
Lou

Re: Passband Intermodulation
BillDumke Oct 15, 2010 2:04 PM (in response to LouPoulo)And a very good starting point I might add!!!
I solved the different bandwidth problem by using two separate summations with different numbers of discrete spectral components, then adding them together and taking the CFFT. Works great. See attached.
Bill

Re: Passband Intermodulation
BillDumke Oct 18, 2010 10:52 AM (in response to LouPoulo)Lou,
I thought f1 and f2 should look two pulses in the frequency domain, but they return to zero before and after each discrete frequency. Will this effect the results for the fa and fb intermod products? I do not care about the very high frequency results. See the last plot of Xm expanded for f1 at the bottom of the attached.
(I don't even understand where the zeros come from since the frequency is just incremented by k for both passbands in the summations.)
Bill

IM example2.mcd.zip 18.4 K

Re: Passband Intermodulation
BillDumke Oct 18, 2010 1:07 PM (in response to BillDumke)Lou,
When the time period Tmax = 1 for a resolution of 1 Hz, then the returns to zero disappear, but the result is the same. The reason for the returns to zero is that k in the summation is not defined for 0.5 Hz frequency steps with Tmax = 2.
Attached is the file with Tmax = 1. With the sheet done this way I can now curve fit the result.
Bill

IM example3.mcd.zip 20.3 K

Re: Passband Intermodulation
BillDumke Oct 18, 2010 1:37 PM (in response to BillDumke)When the summation is done with k from 0 to N instead of 0 to N1, then the frequency passband is symmetric as it should be as well.
Also note the fa 3rd Order Intormodulation Spectrum width of 30 Hz is the f1 10 Hz width multiplied by 3 as it should be. See plots at end of attached.

IM example4.mcd.zip 22.1 K

Re: Passband Intermodulation
LouPoulo Oct 18, 2010 2:57 PM (in response to BillDumke)With Tmax=2, the freq resolution ogf the analysis is 0.5 Hz, which is necessary if the freq components are not at integer freq's. Try your example 4 and change N to 11 and see what happens (lots of "leakage," as it's called).
My example has an incorrect offset formula for the lower band edges. The offset should be by (N1)/2 and not N/2 as in the sheet. the total freq span of N components 1 Hz apart is (N1) Hz, so the lower edge is the desired center fc  span/2 = fc  (N1)/2. changing the summation limit just makes the combs have N+1 terms, and the offset formula is then correct for N+1 terms.
With 1 Hz spacing, the IM products will also have 1 Hz spacing. With Tmax=2, the analysis freq's are multiples of 0.5Hz up to fs, the sampling freq. With actual freq components at 1 Hz intervals, then every other point will be zero. The nonzero ones are the components of interest; you just have more info than you need when there are only integer freq's. With noninteger freq components, but with 1 Hz spacing, you're interested in the odd multiples of 0.5 Hz and not the even multiples. Unfortunately, you get all of them since thew DFT analysis freq set consists all the multiples of the fundamental repetition freq (0.5 Hz with Tmax=2).
The way the example is set up (with corrected offsets), if you have a four freq comb centered at 80 Hz with df= 1Hz, then the actual freq's are 78.5, 79.5, 80.5, and 81.5. If the set of analysis freq's doesn't include all of these (as when Tmax=1), then you get leakage. For a 3freq comb, the freq's are 79,80,and 81 all integers  so Tmax = 1 works.
Unless you use windowing (a completely separate topic), and properly interpret the reults, you need to pick Tmax so that it represents an integral number of periods of the time signal. If the freq components are on a 0.5 Hz grid, then you need Tmax=2. If you have freq's of 1.1, 2.1, 4.2, 5.7, then you need Tmax = 10, since this is the shortest time over which all components are periodic. This is the foolproof way to get all the info. If a component =0, then there's no IM prduct at that freq. Oversampling rarely gets you into trouble.
Lou

Re: Passband Intermodulation
BillDumke Oct 20, 2010 8:49 AM (in response to LouPoulo)Lou,
The attached Example5.mcd file has your correction in it, and it works fine.
But I am still faced with the problem of the zeros in the intermod passbands. I need to do a curve fit without the zeros to see the effect on my receive passband at another frequency passband. How would you recommend solving that problem? I tried changing Tmax to 1 as I did before, but I now get a lot of leakage doing that.
Thanks for your help, Lou.
Bill

IM example5.mcd.zip 20.0 K

Re: Passband Intermodulation
BillDumke Oct 21, 2010 1:05 PM (in response to BillDumke)Here is the solution to get rid of the zeros so some curve fitting can be done on the IM products.
k has to be defined for each 0.5 Hz resolution rrequency.
Therefore in the summation divide k by 2 in the cosine arguments and then sum from k=0 to k=2*(N1).
Bill

IM example6.mcd.zip 23.9 K

Re: Passband Intermodulation
LouPoulo Oct 21, 2010 2:24 PM (in response to BillDumke)The changes made in the last example simply create combs that fit on the freq sampling grid (with no leakage) on consecutive samples, so there are no intervening freq's within a band that are zero. This can be done with fs=1 also, if the combs are constrained to use integer freq's (thus no leakage), and use successive samples (so no intermediate zeroes). This may be OK for the range of models that you plan to look at. However, you may want to model cases where the required sampling freq fs and the repeat time Tmax are such that the IM components don't fall on succesive samples. This is the case for these simple examples, but I don't think that constraining the sampling grid in this manner is good practice. Better to figure out how to allow for the intermediate zero components in the general case. If you can calulate the IM component spacing, and you also know the sampling grid, then you can average/max/select,etc. every N components to get only the correct IM locations.
Lou

Re: Passband Intermodulation
BillDumke Oct 22, 2010 11:06 AM (in response to LouPoulo)Lou,
That is a good point in the general case. I hadn't thought about that problem. I appreciate you putting in the resolution period, Tmax. That will help me with adding in narrowband signals in addition to the wideband signals in the example. Presently I am working with 6 MHz TV passbands for wideband, but I may need to add narrowband FM or digital voice communications signals as well. Those are usually on 5 kHz channel spacings. So I could use Tmax = 200 to do that to save processing power. (5kHz is 1/200 of 1 MHz.) Or I could use Tmax = 1000 for easier entry of the narrowband frequencies.
Anyway, here is how I got rid of the zeros based on Example 5 by finding the local maxima. Attached is Example 7. This will allow me to curve fit the wideband IM data across any given passband at least for the simple case shown here.
Bill

IM example7.mcd.zip 33.0 K




















