Increasing the sampling frequency

I am working on a project where I will be using High voltage and current reading via some sensors and filter ckts to feed into the Arduino, then try to figure out Inductance and Reistnc of the ckt.

For the Arduino Mega I am working at 152200 baud rate. Using Millis() i found it was considering around 2059 inputs per 1000ms. But after adding code, which includes computation of Matrces of 100*100, the count decreased to 9 readings/1000S. I need to increase this rate, since the supply freqcy is around 50-60Hz, my sampling must be 120-130 per 1000sec. Any idea how to attain this!!

Thank you!!

I am working at 152200 baud rate

That's an unusual rate - are you sure?

which includes computation of Matrces of 100*100,

That's a lot of RAM

I agree that you'll probably run into memory limitations. And, you may run into processing speed problems if you try to read the data and make calculations at the same time.

my sampling must be 120-130 per 1000sec.

I assume you mean 120-130 readings per millisecond, or 120-130kHz? If that's analog, the Arduino's ADC is not fast enough. I believe the ADC is useful to around 10kHz (not quite fast enough for high quality audio).

Digital data at that speed should be no problem provided you are not making too many calculations while trying to capture the data.

since the supply freqcy is around 50-60Hz,

[u]Nyquist Sampling Theory[/u] says if the signal is continuous you can get by with a sample rate just above twice the signal frequency. That means you need at least one sample for the positive half of the waveform and one sample for the negative half. For example, audio CDs can contain audio data to (nearly) 22.05kHz with a sample rate of 44.1kHz.

My bad, Baud rate:115200.
Sampling :120 to 130 Hz

Will Using Arduino Due, be a soultion, or any other solution??

Sampling :120 to 130 Hz

Any Arduino can sample faster than that. If you meant kHz, then that is possible if you are willing to sacrifice accuracy.

Serial data transmission is a problem. At 115200 baud, you can send about 11,000 characters/second.

My understanding:

But after adding code, which includes computation of Matrces of 100*100, the count decreased to 9 readings/1000S.

sampling isn't a problem, computation is.
Show your code, and explain why do you need matrices.

I am trying to estimate a R and L value for parallel R_L circuit. For that I am considering 50 data entries for V and I, and solving Linear equations using RK4 and pesudoinverse. this the main idea.

Intially without adding any code, just taking two i/ps and printing it pritnted 2159 data in 1 sec, but when adding code and printng R and L values, it is decreasing bto 10 data per sec.

Can we stop the vague hand-waving and get some details please?

There are mathematical formulas for R-L circuits. All you need to know is the values for R and L. Resistors have a color code and if you build your own coils there is some code in this forum how to measure the basic L values (from ┬ÁH up to the mH range).

I will think about your problem a litte bit more if I can understand what you are really doing.

You can avoid your speed problem if you do not try to output your measurements between mesurements. Store the results in an array and output the results when your measurements are over.