We obtain an analytic solution for the generation of internal gravity waves by tidal flow past a vertical barrier of height $b$ in a uniformly stratified ocean of depth $h\,{>}\,b$ and buoyancy frequency $N$. The radiated power (watts per metre of barrier) is $$\textstyle\frac{1}{4} \pi \rho_0 b^2 U^2 N \sqrt{1-(f/\omega)^2}M(b/h),$$ where $\rho_0$ is the mean density of seawater, $U \cos (\omega t)$ the tidal velocity, and $f$ the Coriolis frequency. The function $M(b/h)$ increases monotonically with $M(0)\,{=}\,1$, $M(0.92)\,{=}\,2$ and $M(1)\,{=}\,\infty$. As $b/h \,{\to}\, 1$, $M$ diverges logarithmically and consequently the radiated power grows as $\ln[(h-b)/b]$. We also calculate the conversion in a realistically stratified ocean with strongly non-uniform buoyancy frequency, $N(z)$. A rough approximation to the radiated power in this case is $$\textstyle\frac{1}{4} \pi \rho_0 b^2 U^2 N(b) \sqrt{1- (f/\omega)^2} M(B/\pi),$$ where $N(b)$ is the buoyancy frequency at the tip of the ridge and $B$ is the height of the ridge in WKB coordinates. (The WKB coordinate is normalized so that the total depth of the ocean is $\pi$.) The approximation above is an over-estimate of the actual radiation by as much as 20% when $B/\pi \,{\approx}\, 0.8$. But the formula correctly indicates the strong dependence of conversion on stratification through the factor $N(b)$.