Go Back   Home > Forums > Amplifiers > Solid State
Home Forums Rules Articles Store Gallery Blogs Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Solid State Talk all about solid state amplification.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 22nd November 2007, 10:55 AM   #1
diyAudio Member
 
Onvinyl's Avatar
 
Join Date: Aug 2002
Location: Germany
Default Spice for beginners?

In the 'permanent' spice thread, someone suggests a 'basic spice' course or wiki. Does something like this exist here?
For the moment, I have a RC-loaded circuit the distorts heavily where I thought it wouldn't *and* one that behaves well where I thought it shouldn't work [neat|at all].
I guess I'm not the only one...

What I have in mind are some kind of 'standard treatments' in very basic circuits (high and low pass, 1-Q-followers or -gain blocks and the like).

Rüdiger
__________________
"I can feel what's going on inside a piece of electronic equipment. I have a sense that I know what's going on inside the transistors." Robert Moog
  Reply With Quote
Old 22nd November 2007, 11:33 AM   #2
AndrewT is offline AndrewT  Scotland
diyAudio Member
 
Join Date: Jul 2004
Location: Scottish Borders
nice idea
__________________
regards Andrew T.
  Reply With Quote
Old 22nd November 2007, 12:36 PM   #3
Account disabled at member's request
 
MJL21193's Avatar
 
Join Date: Mar 2007
That's a very good idea. I like it.
  Reply With Quote
Old 22nd November 2007, 01:13 PM   #4
diyAudio Member
 
PigletsDad's Avatar
 
Join Date: Jul 2007
Location: South Worcestershire
See http://newton.ex.ac.uk/teaching/CDHW...cs2/userguide/

There are some examples, I think in one of the appendices.
  Reply With Quote
Old 23rd November 2007, 10:15 AM   #5
diyAudio Member
 
Onvinyl's Avatar
 
Join Date: Aug 2002
Location: Germany
May I present a problem which should lead us to some basic RC-treatments?

Beneath is a riaa network(, fed by an ideal sine wave and inversed and 'gained' by an ideal inverter/amplifier.

A distortion measurement as displayed gives me a THD of 3.56%!
This method is given by Klaus (KSTR here) and gives reasonable numbers for a bunch of well documented circuits I tried.

As I think, that an 'ideal' phono pre shouldn't distort that much, there should be mistakes in this setup.


Which?

Rüdiger
Attached Images
File Type: jpg riaa.jpg (17.9 KB, 349 views)
__________________
"I can feel what's going on inside a piece of electronic equipment. I have a sense that I know what's going on inside the transistors." Robert Moog
  Reply With Quote
Old 23rd November 2007, 11:12 AM   #6
KSTR is offline KSTR  Germany
diyAudio Member
 
KSTR's Avatar
 
Join Date: Jul 2007
Location: Central Berlin, Germany
A reported "problem", see
http://www.diyaudio.com/forums/showt...19#post1246419

And the user manual reads:
"The transfer function of this circuit element is specified by its Laplace transform. The Laplace transform must be a function of s. The frequency response at frequency f is found by substituting s with sqrt(-1)*2*pi*f. The time-domain behavior is found from the impulse response, which is found from the Fourier transform of the frequency-domain response. LTspice must guess an appropriate frequency range and resolution. The response must drop at high frequencies or an error is reported. It is recommended that the LTspice first be allowed to make a guess at this and then check the accuracy by reducing reltol or explicitly setting nfft and window. The reciprocal of the value of window is the frequency resolution. The value of nfft times this resolution is the highest frequency considered."

In reality (within the simming context), you don't have any distortion in the time domain, because both the laplace and the passive components are LTI (linear time-invariant). One can model nonlinear caps and resistors, though.

- Klaus
  Reply With Quote
Old 23rd November 2007, 11:32 AM   #7
diyAudio Member
 
Onvinyl's Avatar
 
Join Date: Aug 2002
Location: Germany
Hi Klaus,
thanks for your answer.
I have to admit, though, that I'm completly lost here.
Are you saying that I shouldn't get the THD-numbers I quoted? Or that I should ignore them? Then the word 'problem' shouldn't go with quotes because any analog filter circuits can't easily be tweaked.

thanks,
Rüdiger
__________________
"I can feel what's going on inside a piece of electronic equipment. I have a sense that I know what's going on inside the transistors." Robert Moog
  Reply With Quote
Old 23rd November 2007, 12:00 PM   #8
diyAudio Member
 
PigletsDad's Avatar
 
Join Date: Jul 2007
Location: South Worcestershire
There should be no THD.

Your problem is that you have not allowed any settling time, so the output waveform is distorted by the initial charging transients.

Accurate simulations require the use of extra start time parameter in the .tran card.
  Reply With Quote
Old 23rd November 2007, 12:04 PM   #9
KSTR is offline KSTR  Germany
diyAudio Member
 
KSTR's Avatar
 
Join Date: Jul 2007
Location: Central Berlin, Germany
Rüdiger,

Yes, you should get a straight zero for THD, because all elements are linear with regard to voltage and current. More precisly, you get the generator's intrinsic distortion multiplied with gain error at the harmonic frequencies. Say you input is 1kHz with a -90dB H2 component and your frequency response error is -1dB at 1kHz -3dB at 2kHz, H2 would come out as -92dB. But the generator distortion is really low, <= -160dB when using a small max timestep.

The errors you see come from the problems of doing the Laplace transform in the time domain, in LTSpice. Seems that one can't use it at all or has to know all the guru tweaks to get reasonable results (I don't).

Dad also raised a point... so try that first, let it run for like 20 cycles and then .four the last ot these (which it does by default).

- Klaus
  Reply With Quote
Old 23rd November 2007, 01:11 PM   #10
diyAudio Member
 
Onvinyl's Avatar
 
Join Date: Aug 2002
Location: Germany
Well, ok, seems I should read the error log as such as well...

"Frequency response of Laplace device "E1" does not roll-off fast enoughLaplace source: E1
WARNING: This Laplace expression needs an additional delay of 23.2µs to not violate causality.
Freq Domain: peak @ 0Hz BW=0Hz cutoff @ 0Hz
resolution: 250Hz nfft=16384
Time Domain: window=0.00196045s resolution: 2.44141e-007s
Second Compression Ratio=422.632
"
I altered the tran command to
.tran 0 {10*(ncycles*period)} 0 {pi/3.14*period/2e3}

this gives me a thd of .055%.
With

.tran 0 {20*(ncycles*period)} 0 {pi/3.14*period/2e3}
I get 0.022%.

The command
.tran 0 {100*(ncycles*period)} {99*(ncycles*period)} {pi/3.14*period/2e3}
gives .000134%

the same as
.tran 0 {100*(ncycles*period)} 0 {pi/3.14*period/2e3} to check if the simulator really choses the last cycle(s).

So, if one has the time (ran ~ 10minutes on my 2.4 GHz (or the like) PC it is at least usable to see if your circuit develops issues with one's RC- network.

Thanks!
Rüdiger
__________________
"I can feel what's going on inside a piece of electronic equipment. I have a sense that I know what's going on inside the transistors." Robert Moog
  Reply With Quote

Reply


Hide this!Advertise here!

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Free Spice Or Cheap Spice Simulator-Where To Start? kelticwizard Everything Else 29 15th February 2007 01:38 AM
F2 for beginners vitalstates Pass Labs 6 24th January 2007 12:02 AM
beginners q's lt cdr data Solid State 3 23rd May 2005 09:59 PM


New To Site? Need Help?

All times are GMT. The time now is 10:07 PM.

Page generated in 0.12354 seconds (79.67% PHP - 20.33% MySQL) with 11 queries

Copyright ©1999-2012 diyAudio