How to get LUT values from the NCO object?

3 visualizzazioni (ultimi 30 giorni)
Jay
Jay il 20 Feb 2025
Modificato: colordepth il 10 Mar 2025
I'm trying to learn NCO and MATLAB has the following example.
df = 0.05; % Frequency resolution = 0.05 Hz
minSFDR = 96; % Spurious free dynamic range >= 96 dB
Ts = 1/8000; % Sample period = 1/8000 sec
dphi = pi/2; % Desired phase offset = pi/2;
Nacc = ceil(log2(1/(df*Ts)));
actdf = 1/(Ts*2^Nacc);
Nqacc = ceil((minSFDR-12)/6);
phOffset = 2^Nacc*dphi/(2*pi);
nco = dsp.NCO('PhaseOffset', phOffset,...
'NumDitherBits', 4, ...
'NumQuantizerAccumulatorBits', Nqacc,...
'SamplesPerFrame', 1/Ts, ...
'CustomAccumulatorDataType', numerictype([],Nacc));
With info, I got the following:
>> info(nco)
ans =
struct with fields:
NumPointsLUT: 4097
SineLUTSize: 8194
TheoreticalSFDR: 96
FrequencyResolution: 3.8147e-06
Here is my question. How can I see the actual 4097 LUT values?

Risposte (1)

colordepth
colordepth il 10 Mar 2025
Modificato: colordepth il 10 Mar 2025
The documentation for "dsp.NCO" states that it uses the same algorithm as the NCO block, as stated here: https://www.mathworks.com/help/dsp/ref/dsp.nco-system-object.html#bsfy7o1-6. The algorithm description can be found here: https://www.mathworks.com/help/dsp/ref/nco.html#mw_51f00334-ea26-4072-9715-49115eae1159.
If dither is disabled during the construction of the "dsp.NCO" object, it appears that "nco" essentially returns parts of the lookup table as the output. With this understanding, you can infer the lookup table values by adjusting the "SamplesPerFrame" of your NCO object and using an appropriate "Phase Increment".
Alternatively, the Signal Processing Toolbox includes an example implementation of the NCO algorithm. You can access and analyze this example to understand the lookup table by using the following command:
openExample('signal/SFDRMeasurementExample')

Tag

Prodotti


Release

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by