### Harry Commin (@weetabixharry)

## Generating Partially Correlated Random Variables

IntroductionIt is often useful to be able to generate two or more signals with specific cross-correlations. Or, more generally, we would like to specify an $\left(N \times N\right)$ covariance matrix, $\mathbf{R}_{xx}$, and generate $N$ signals which will produce this covariance matrix.There are many applications in which this technique is useful. I discovered a version of this method while analysing radar systems, but the same approach can be used in a very wide range of...

If you're familiar with MATLAB, then you can work through the full example of MUSIC I originally posted here back in 2013.The code is heavily commented and doesn't...

There doesn't seem to be anything fundamentally different about "frame-based" processing in MATLAB. The frames are not independent. Simply, the sample data is collected...

@kaz My sample rate is 4 GSps. So I was saying I can't clock my FFT core at 8 GHz (or 16 GHz, with 1/2-overlap) and reuse it for the IFFT. I will clock it at 250...

@kaz My FIR filters are large, so DSP slice utilization is reduced immensely by implementing them in the frequency domain. (By a rough calculation, the reduction...

@samecues I have read that WOLA article and some other papers related to WOLA. However, I cannot see anything related to a simple linear filter (like a lowpass filter).You...

@samecues You understood exactly. And my filter is just a lowpass filter.If I understood you correctly, you are saying that by changing my Hann "analysis" window...

@kschutz I'm not specifically tied to Welch's method and I had also considered your "poor man's power spectrum". It's something I would probably resort to if I...

I am familiar with the overlap-add and overlap-save methods for computing linear convolutions.I am also familiar with Welch's method for estimating power spectral...

You haven't said what the problem is. Since you are just using MATLAB's pre-packaged functions, I suggest you read the MATLAB documentation (which is typically quite...

I can, but your questions are too general. The literature on this topic is vast, so you will need to narrow down what it is you are trying to understand.Do you mean...

I'm not sure if you're aware that we commonly use at least 2 different symmetries in window functions. You mentioned (or implied) that you don't have a practical...

@Mannai_Murali Why not share your code here in the forum so someone else may benefit from it in the future?@Ali23 Do you specifically need an example in MATLAB or...

The rough idea is that the +/- sign of the error should tell you to either increase or decrease the sample rate in your receiver.The point is that the sample clock...

I can't really say much about the first figure. I guess it shows your signal is not all zeros, which is a good start.Your second figure shows effectively all zeros...

Please attach your graphs and code for conventional beamforming.It is only a small modification to convert that to use MUSIC.

I don't know what your hardware setup is, but it is surprising to me that you talk about sound recordings and the speed of light. I would expect the speed of sound...

If the other methods are working, then I'm not sure exactly what you want to know. Presumably, you have already been able to calculate the received signal covariance...

I'm not sure if I understand your question. If you already have some received data, then you don't need to generate it, so you can ignore sections (1) and (2) of...

Your calculation of the direction matrix A looks incorrect to me. This matrix should include information about the source directions and the geometry of your sensor...

@kaz Quantization doesn't change anything.We can constrain the maximum input amplitude to be any number (quantized or not - it doesn't make any difference).And rounding...

@kaz If you don't impose any constraints on the input signal, then the output signal can be infinitely large (e.g. if you multiply all of your input signals by Inf).Therefore,...

@kaz For a FIR filter, the impulse response (y) is the filter (h). At the end of your code, if you compare y and h, you will find they are identical.
So you have...

@hirnprinz Thank you very much for sharing that article. That was exactly the track I ended up going down. After reading the article, it seems so obvious, but I...

@kaz As the name suggests, an exact representation would typically need infinitely many FIR taps (in the same way that we would need an infinite sample rate and...

@dszabo This worked really well (once I remembered to flip the order of the FIR taps to get the convolution in the correct order).I wasn't really sure how to choose...

Yes, this is basically what I am researching.If we reduce the input amplitude, then the question remains: "by how much should it be reduced (for a given filter)?".If...

@philipoakley Thank you. This sounds logical. I need to mull it over, but I think this is going in the right direction...

@kaz I have written fixed-point software models that include the internal rounding.I have tested with a wide variety of input signals (including Gaussian noise,...

@Slartibartfast With a FIR filter, I feel like I have a clear idea about how to make this design decision. I can calculate exactly what the maximum output value...

@dgshaw6 In my current work, I am only dealing with 1st order filters. Does your rule of thumb apply there too?With all of the test signals I have tried, I haven't...

@dszabo An impulse will not typically produce the largest possible amplitude at the output of the filter (in the time domain).

@kaz As I said in my original post, even if gain (in the frequency domain) is < 0dB across all frequencies, the output amplitude (in the time domain) can still...

@philipoakley Maybe I can understand better using a specific example. I have a filter with this transfer function:$$H(z) = \frac{1 - z^{-1}}{1 - Az^{-1}}$$where...

When implementing a fixed-point digital filter, I need to think about overflow/saturation.
For a FIR filter, the maximum +/- output values (OUTPUT+ and OUTPUT-) are...

I didn't fully understand your description, but please note that the ideal way to fix this is in the time domain (by aligning the samples fed to your software FFT...

Are the time-domain samples aligned identically into both the hardware and software FFTs?A shift in the time-domain corresponds to a phase ramp in the frequency...

If there is only one signal arriving from one direction, then M=1.If there is one signal source, but arriving from multiple directions (due to reflections/echoes),...

If a simple Matlab implementation would be instructive, then take a look at this forum post I wrote some years ago.Later in the same thread, I expanded it to 2D...

@kaz I assume it's because Matlab is an interpreted language, so there isn't a compiler doing that kind of optimization.

The sequences don't repeat indefinitely in WiFi, or there would be no way to transfer any information. WiFi is a bursty signal, so some useful "preamble" is prepended...

If I understand correctly, you expect the "true" autocorrelation peak to correspond to the offset for which all the cyclic prefixes in the capture are aligned with...

Are you sure these built-in autocorrelation functions do what you want? I suspect they don't, unless you are being pretty careful about how you feed them data.Or...

Is it possible that the sequence you are autocorrelating contains a repeating, repeating pattern? (i.e. something that repeats several times).This is pretty common,...

The thing I feel more worried about is whether a real-valued mixer is definitely suitable for your application.However, as per emeb's reply, I don't feel worried...

Everything in those Matlab scripts is specified explicitly in the 802.11 specification. The comments in the Matlab code refer to the part of Annex I (e.g. "I.1.3.2"...

Have you seen Annex I of the 802.11 PHY standard? This takes you through every step of the 802.11a/g modulation process to make sure you get everything exactly right....

If I understand what you are trying to do, then I don't think the method of finite difference is the best choice. As far as I know, the method of finite difference...

If you use Matlab, then I think these 2 very simple lines of code sum up Least Squares polynomial curve fitting very well:C = bsxfun(@power, (0:L).', (0:N));
a =...

@kaz I understand the principle of rational-ratio resampling, but the challenge here lies in determining (in closed form) where the redundancy will be. Or, equivalently,...

@kaz I don't think I follow your explanation. Could you give a simple example? For example, if I want 6 parallel inputs and 8 parallel outputs (interpolation by...

@Slartibartfast Fixed resample rate. The resample rate can even be 1. For example, the most popular structure in the literature seems to be the "two-parallel FIR...

I am struggling to find a good reference for implementing parallel rational-ratio FIR resampling filters. By "parallel", I mean a high-throughput hardware filter...

My 4-year "undergraduate Masters" at Imperial College London (2005 - 2009) cost around £3,600 total in tuition. I believe it's now £9,000/year tuition for EU...

Does N change only at compile time, or at run time too?Do the frequencies that you want to generate change only at compile time?Could you explain a little more about...

Thanks for the clarification. I think an extra sentence in the original post to provide any kind of context would have eliminated any doubt. It's now obvious it...

I agree that this is likely to be a problem in many applications. However, not necessarily, since it depends what Yash5 wants to do with the data. I don't think...

I think the most direct answer to your question is that you could buy the smallest, cheapest FPGA on the market and use it to simply deinterleave (split) your samples...

I second the "print to pdf" option suggested by rrlagic. A possible downside to this is that you will lose any metadata (such as links within the document).My favourite...

Sounds like interpolating. What is the context?I second that. In fact, that's more or less word-for-word what I was going to reply.

This is not correct in general, and I don't think @dsplearn has provided enough information to be sure that it is definitely suitable for them.If, for example, your...

I would like to add that "discarding" is not your only option when you want to divide a fixed-point number by $2^n$. Discarding in this context is referred to as...

@neiroberI could be misunderstanding, but there may also be different (equally valid) ways to look at it. In the summary, I see Steps 1 and 2 as moving all the FIR...

@neiroberI read through your post quickly and, if I understand correctly, you are saying that the multi-stage decimator is still equivalent if we reorder the filtering...

@neiroberGreat, thanks Neil. I am amazed (and a little embarrassed) that I didn't find your post in any of my Google searches.This looks like really valuable material...

@Rick LyonsBrilliant. Thank you for the excellent response. Your article looks like exactly what I was looking for from the start (if only I had entered better search...

Ahhh, I see. That makes sense. I'm just now starting to realise what that lecture 13 years ago was about!If a system is not LTI, I'm a bit lost...
In the case of...

Firstly, I would like to offer my deepest condolences that you have to work with LabVIEW. In my opinion, it is quite nice for connecting simple pieces of hardware...

Use this form to contact **weetabixharry**

Before you can contact a member of the *Related Sites:

- You must be logged in (register here)
- You must confirm you email address