Hi there,
when I alter the frequency of the flexi tonegenerator during running in PPS on TAS3204-EVM two or three times no tone is produced any more.
Any idea?
Also I will have to alter the tone generator frequency by MCU via I2C. How does a frequency value lets say 0.008333 2(f0/fs) fit into the four byte hex coeficient?
Thanks for any response.
Thomas
Susan,
1) a pfw with only the sinegenerator and an output does the same.
2) My resource usage:
3) Please find the component attached.
Could you please find some time to spend on this. I now did spend already a lot of time and I get a little under pressure now.
Thank you very much.
Thomas,
Please try the attached componet: I fixed couple of mistakes in the .asmx file, you could take a look to see the differences. Also, I was wrong about the beta, it was scaled, so when you do the calculation, you need to put in the number *2^16.
And also, remember to disable and enable the tone generator when you switch between different frequencies.
Regards,
Susan
Does not change really, Susan.
I made sure that the component you send is used by removing the old from the directories componentcach, componentlibrary and usercomponentlibrary.
I can read the updated alpha and beta with the I2C memory tool but when the sinegenerator is enabled there is a strong increase in gain though the frequency is right and the beta changes every time I read the I2C address.
Thanks for further help....
Hoping...
OOPS got the scaling of beta wrong, sorry...
I be be back after correcting...
All right, it is working now, Susan.
There is one more thing.
I acctually would have to do a so called warble sweep with the sine wave. This is sweeping the sine wave from 20 to 20000 Hz while swinging round the center sweep frequency with 1/3 octave.
That means that I have to diable - update alpha beta - eable like ten times a second wich makes a horrible noise.
Now, is there any chance to work with two alphabeta registers and a third register to tell wich alphabeta register to work from?
This way I could update the alphabeta register A while the sinegenerator is working from the alphabeta register B
then switch to A and update B.
That would be realy a great thing.
Any thoughts on this?
Thanks,
I think it's doable. But it would require more changes than the previous change when converting from the existing FlexiTonGen.
You would need to:
1) change the two .xml files to add in the new alpha, beta and the selection
2) change the .asmx file to add in the source code to swap between the two sets of alpha/beta based on the selection
regards,
Thank you Susan.
But do you think that it is possible to change alpha and beta on the fly or do we have to disable - select - enable?
without disable/enable, that would be difficult. Because we need that to restore the initial state. I am trying to think of another way to do it, but no luck yet.
Susan, I found a algorithm to calculate a sine wave but it is in C:
// Input angle from -pi/4 to pi/4dsp16_t dsp16_op_kernel_sinfix(dsp16_t angle){ // Coefficients of the 5th order Tchebychev polynom to calculate a sine. const dsp16_t s1 = DSP16_Q(0.785369873046875); const dsp16_t s3 = DSP16_Q(0.322784423828125); const dsp16_t s5 = DSP16_Q(0.03875732421875); S32 z, suma;
// Computation of the polynom z = (angle*angle) >> (DSP16_QB - 3); suma = s3 - ((z*s5) >> (DSP16_QB + 1)); suma = s1 - ((z*suma) >> (DSP16_QB + 1));
return (angle*suma) >> (DSP16_QB - 2);}
Could this be translated int assembler for the TAS?
Have you tried to use this code to generate sine wave? I am not 100% positive about it since usually polynomial approach is fine to calculate a sin(x) value based on the angle x, but when using it to generate sine wave, there might be discontinouity in the wave.
If you've confirmed the wave form is ok, then this algorithm can be implemented in TAS3x.
This is right Susan.If we want to generate a sinsweep with a continous waveform we would have to be able to alter the frequency with the right phase. The code that I found is only the sin function. But it is a start. So we would need something like sin(2*pi*f/fs*t + phase).
Wouldn´t we?
Thanks for any further idea.
That's right. The problem with the polynomial approach is the possibility of discontinounity due to limited precision. The most commonly used method on fixed-point DSP is lookup table, but indexing in TAX3x is very expensive, it's possible though. So far, the IIR implementation in TAX3x is still the most efficient and simple method.
But your requirment is beyond just generating a sine wave, so that's difficult to realize in TAS3x.
Susan, it´s me again.Is there any possibility to try the polynomial approach and find out if it is enough precise?If I can not solve this our customers would have to run long audio cables to the amp every time.
Thanks for any thoughts on that.
There are many polynomial approches and all have limitations: the one you posted, for example, has to be within [-pi/4, pi/4], which can only be used to estimate small angles, not suitable for sine generator. And since TAS3x is fixed point, that definitely added more constrains.
The only way I could think of is how to make the one we have work by sending the disable/enable and change frequency fast enough to generate the sweep signal, other than that, I run out of ideas.